- 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 - AM/PM
This method helps in customizing the meridiem as per locale.
Syntax
moment.updateLocale('en', {
meridiem : Function
});
Example
var localeData = moment.updateLocale('fr', {
meridiem: function (hours, minutes, isLower) {
return hours < 12 ? 'PD' : 'MD';
}
});
var m = moment('2016-01-01T05:00:00').format('hh a');
Output
momentjs_customization.htm
Advertisements