How to do a greater than or equal to with moments (moment.js) in javascript?

后端 未结 3 595
忘了有多久
忘了有多久 2021-02-01 00:16

Basically, I want to do a myMoment >= yourMoment. There is no myMoment.isSameOrAfter and writing that out combining isSame and .i

3条回答
  •  遥遥无期
    2021-02-01 00:52

    You can use the isSameOrAfter method in momentjs:

    moment1.isSameOrAfter(moment2);
    

提交回复
热议问题