How to check if input date is equal to today's date?

后端 未结 10 1111
忘了有多久
忘了有多久 2020-11-28 05:13

I have a form input with an id of \'date_trans\'. The format for that date input (which is validated server side) can be any of:

  • dd/mm/yyyy
  • dd-mm-yyyy
10条回答
  •  渐次进展
    2020-11-28 05:42

    TodayDate = new Date();
    if (TodayDate > AnotherDate) {} else{}
    

    < = also works, Although with =, it might have to match the milliseconds.

提交回复
热议问题