Check if date is in the past without submitting form

前端 未结 6 1379
抹茶落季
抹茶落季 2020-12-19 08:44

I have this code that I want to check if a date is in the past. I want to check it as soon as the date is entered, before form submission.



        
6条回答
  •  借酒劲吻你
    2020-12-19 09:15

    The date() function returns a string. Try converting both dates to integers first using the Date.parse() function:

    
    
    

提交回复
热议问题