On using the javascript technology you can perform the comparison operation very quick in real time.
In this case we will see how to compare two given date:-
var DateOne = "1991-10-10".split('-');
var DateTwo = "2005-09-01".split('-');
var firstDate=new Date();
DateOne.setFullYear(firstValue[0],(firstValue[1] - 1 ),firstValue[2]);
var secondDate=new Date();
DateTwo.setFullYear(secondValue[0],(secondValue[1] - 1 ),secondValue[2]);
if (firstDate > secondDate)
{
alert("First Date is greater than Second Date"); //your output
}
else
{
alert("Second Date is greater than First Date"); //your output
}
0 Comment(s)