Internationalization

Internationalization is one of the important features in MomentJS. You can display Date and Time based on localization, in other words, based on the country/region. The locale can be applied to specific moment if required.

This chapter discusses in detail about how to make apply locale globally, locally, work with locale using Node.js, in browser, get the units (months, weekdays etc.) in the required locale etc.

Sr.No.Locale & Description
1Global localeWe can assign locale globally and all the date /time details will be available in the locale assigned.
2Changing Locale LocallyWe need locale to applied locally in case we need to handle many locales in an application.
3Using Locale in BrowserWe can start working with locale by including the locale file in script tag.
4Using Locale using Node.jsIf you happen to use Node.js , you will have the locale files already in moment when you do npm install moment.
5momentjs_Listing date/time details of current localeYou can set the locale and check the details like months, weekdays etc.
6Checking current localeWe can check the current locale using moment.locale().
7Accessing Locale Specific FunctionalityHere will see the methods and properties available on currently loaded locale.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *