When i am trying to compare the two dates using date.toLocaleString() it is not giving the correct answer for some months date.
var date1 = new Date();
var date2 = new Date((new Date()).valueOf() + 1000*3600*24);
if(date1.toLocaleDateString() < date2.toLocaleDateString())
{
alert("Correct");
}
else
{
alert("Incorrect");
}
Can anyone have solution for this.