Compare two dates in JavaScript using moment.js - Poopcode

PHOTO EMBED

Thu Jan 20 2022 10:57:33 GMT+0000 (UTC)

Saved by @arielvol #undefined

moment('2019-05-11').isSame('2019-05-12','year'); // true
moment('2018-05-11').isSame('2019-06-12','year'); // false
content_copyCOPY

https://poopcode.com/compare-two-dates-in-javascript-using-moment/