Categories
JavaScript Answers

How to do a greater than or equal to with moment.js in JavaScript?

Spread the love

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.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *