[Solved] how to fix the validation for date

[ad_1]

You are comparing string with a string

Try like this

var userDate=new Date(x);
var currDate=new Date()
if (+userDate <= +currDate ){ // + will convert date into miliseconds
    alert("Please select a higher date!");
    return false;
}

2

[ad_2]

solved how to fix the validation for date