- MomentJS Tutorial
- MomentJS - Home
- MomentJS - Overview
- MomentJS - Environment Setup
- MomentJS - Introduction
- MomentJS - Parsing Date And Time
- MomentJS - Date Validation
- MomentJS - Getter/Setter
- Manipulate Date And Time
- Formatting Date And Time
- MomentJS - Date Queries
- MomentJS - Internationalization
- MomentJS - Customization
- MomentJS - Durations
- MomentJS - Utilities
- MomentJS - Plugins
- MomentJS - Examples
- MomentJS Useful Resources
- MomentJS - Quick Guide
- MomentJS - Useful Resources
- MomentJS - Discussion
MomentJS - Global locale
We can assign locale globally and all the date /time details will be available in the locale assigned.
Syntax
moment.locale(String); moment.locale(String[]); moment.locale(String, Object);
Example
moment.locale("hi"); var a = moment.duration(1, 'days').humanize(); var b = moment.duration(1, 'week').humanize();
Output
Example
moment.locale("hi"); var a = moment().fromNow();
Output
Example
moment.locale("pt"); var a = moment().locale();
Output
momentjs_internationalization.htm
Advertisements