function Convet_CompareDates()
{
date1 = "11/06/2013";
date2 = "17/05/2013";
date1c = date1.split("/").reverse().join("-");
date2c = date2.split("/").reverse().join("-");
var datet1 = new Date(date1c);
var datet2 = new Date(date2c);
if(datet1>datet2)
{
alert('less');
}
else
{
alert('greater');
}
}
{
date1 = "11/06/2013";
date2 = "17/05/2013";
date1c = date1.split("/").reverse().join("-");
date2c = date2.split("/").reverse().join("-");
var datet1 = new Date(date1c);
var datet2 = new Date(date2c);
if(datet1>datet2)
{
alert('less');
}
else
{
alert('greater');
}
}
No comments:
Post a Comment