- 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 Parsing
You can parse AM/PM using this method.
Syntax
moment.updateLocale('en', {
meridiemParse : RegExp
isPM : Function // will return true or false.
});
Example
var localeData = moment.updateLocale('fr', {
meridiemParse: /PD|MD/,
isPM: function (input) {
return input.charAt(0) === 'M';
}
});
var m = localeData.isPM("MD");
Output
momentjs_customization.htm
Advertisements