- 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 - 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
To Continue Learning Please Login
Login with Google