Check if date is in the past without submitting form

前端 未结 6 1377
抹茶落季
抹茶落季 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

    You can use

    
    _isDate1LowerThanDate2(date1, date2) {
        return new Date(date1) < new Date(date2);
      }
    
    

提交回复
热议问题