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.

Leave a Reply

Your email address will not be published.

If you like the content of this blog, subscribe to my email list to get exclusive articles not available to anyone else.