Sometimes, we want to do a greater than or equal to with moment.js in JavaScript.
In this article, we’ll look at how to do a greater than or equal to with moment.js in JavaScript.
How to do a greater than or equal to with moment.js in JavaScript?
To do a greater than or equal to with moment.js in JavaScript, we can use the isSameOrAfter
method.
For instance, we write
moment1.isSameOrAfter(moment2);
to check if the datetime in the moment1
is the same or after the datetime in the moment2
moment object.
Conclusion
To do a greater than or equal to with moment.js in JavaScript, we can use the isSameOrAfter
method.