var dt_from = "2013/05/25";
var dt_to = "2013/05/25";
if(dt_from == dt_to)
{
alert("Both dates are Equal!");
}
else if(dt_from > dt_to)
{
alert("From date should not be greater than todate!");
}
else if(dt_from < dt_to)
{
alert("Okay!");
}
上面的代码工作正常。但以下代码不起作用:
var dt_from = new Date("2013/05/25");
var dt_to = new Date("2013/05/25");
if(dt_from === dt_to)
{
alert("Both dates are Equal!");
}
else if(dt_from > dt_to)
{
alert("From date should not be greater than todate!");
}
else if(dt_from < dt_to)
{
alert("Okay!");
}
这 if(dt_from === dt_to)
不适用于上面的代码。任何想法?