- 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 - Changing Locale Locally
We need locale to applied locally in case we need to handle many locales in an application.
Here is a way to work with locale locally.
Syntax
moment().locale(String|Boolean);
Example
moment.locale("pt"); var a = moment().fromNow(); moment.locale("hi"); var b = moment().fromNow();
Output
Example
moment.locale("pt"); var a = moment().format('LLLL'); moment.locale("hi"); var b = moment().format('LLLL');
Output
momentjs_internationalization.htm
Advertisements