📅  最后修改于: 2020-10-22 06:23:30             🧑  作者: Mango
国际化是MomentJS的重要功能之一。您可以基于本地化(即基于国家/地区)显示日期和时间。如果需要,可以将语言环境应用于特定时刻。
本章详细讨论如何在全局,本地,在浏览器中使用Node.js来使用语言环境,在浏览器中获取语言环境,如何在所需语言环境中获取单位(月,日等)。
Sr.No. | Locale & Description |
---|---|
1 | Global locale
We can assign locale globally and all the date /time details will be available in the locale assigned. |
2 | Changing Locale Locally
We need locale to applied locally in case we need to handle many locales in an application. |
3 | Using Locale in Browser
We can start working with locale by including the locale file in script tag. |
4 | Using Locale using Node.js
If you happen to use Node.js , you will have the locale files already in moment when you do npm install moment. |
5 | momentjs_Listing date/time details of current locale
You can set the locale and check the details like months, weekdays etc. |
6 | Checking current locale
We can check the current locale using moment.locale(). |
7 | Accessing Locale Specific Functionality
Here will see the methods and properties available on currently loaded locale. |