- 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 - Invalid
This method allows you to define your own invalid object for a moment.
Syntax
moment.invalid(Object);
Example
In the following example, we are setting the invalidMonth and passing the same as object to invalid method. This helps to create the list of invalid checks of our choice to be validated with the moment.
var m = moment.invalid({ invalidMonth: 'reptember' }); var a = m.parsingFlags().invalidMonth;
Output
momentjs_utilities.htm
Advertisements