- 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 Same or After
This method checks if the moment is same or after another moment. It returns true or false.
Syntax
moment().isSameOrAfter(Moment|String|Number|Date|Array); moment().isSameOrAfter(Moment|String|Number|Date|Array, String);
Example
var issameorafter = moment('2017-10-10').isSameOrAfter('2017-10-09');
Output
We can use the units with isSameOrAfter() and the ones supported are year, month, week , day, hour, minute and second.
Example
var issameorafter = moment('2017-10-10').isSameOrAfter('2017-10-09', 'year');
Output
Example
var issameorafter = moment('2017-10-10').isSameOrAfter('2017-10-15', 'day');
Output
momentjs_date_queries.htm
Advertisements
To Continue Learning Please Login
Login with Google