jQuery function to compare date with current date

前端 未结 5 1902
生来不讨喜
生来不讨喜 2020-12-06 22:47

i am entering date of birth in form by entering date in separate text box ,selecting year from drop down and entering year in text box. Now i want to check that entered date

5条回答
  •  死守一世寂寞
    2020-12-06 23:15

    Check if this can help:

    var TodayDate = new Date();
    var endDate= new Date(Date.parse($("#EndDate").val()));
    
    if (endDate> TodayDate) {
        // throw error here..
    }
    

    https://stackoverflow.com/a/40039798/885627

提交回复
热议问题