I have tried the following code to compare two dates
//the following check validates that the date is entered in the right format and it works
if(s_period=="" || !date_format.exec(s_period))
{
alert("Please enter start date as YYYY-MM-DD");
return false;
}
//next, i want to check if s_period is greater than '2013-06-30'
if((new Date(s_period).getTime()) < (new Date("2013-07-01").getTime()))
{
alert("Stat available from 2013-07-01");
return false;
}
The above alert for choosing a date after 2013-06-30 gets invoked in Firefox but, NOT on IE8. Can someone suggest the additional code I need to add to make it work across all browser version? Thanks