- 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 - Is Between
This method will return true or false if the moment is between other two moments.
Syntax
moment().isBetween(moment-like, moment-like); moment().isBetween(moment-like, moment-like, String);
Example
var isbetween = moment('2015-05-01').isBetween('2009-10-19', '2018-10-25');
Output
Example
var isbetween = moment('2015-05-01').isBetween('2009-10-19', '2018-10-25', 'year');
Output
You can use the units year, month, week, day, hour, minute and second along with the method as shown above.
momentjs_date_queries.htm
Advertisements