How to compare only date in moment.js

后端 未结 5 2062
余生分开走
余生分开走 2020-12-08 03:38

I am new to moment.js. I have a date object and it has some time associated with it. I just want to check if that date is greater than or equal to today\'s date,

5条回答
  •  离开以前
    2020-12-08 04:14

    Meanwhile you can use the isSameOrAfter method:

    moment('2010-10-20').isSameOrAfter('2010-10-20', 'day');
    

    Docs: https://momentjs.com/docs/#/query/is-same-or-after/

提交回复
热议问题