Saturday, 27 September 2014

Compare between tow dates after converting using javascript

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');
}
}

No comments:

Post a Comment

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...