How can I check that a date is greater than or less than the specified date using javascript by passing the month and year only in MMM-YYYY
Format.
For example :
Let the user selects JUL from month dropdown and 2016 from years dropdown ,
Now How can I check that the selected values are greater than / less than JUN 2016 .
I've taken the input in Session variables as session("month") , session("yrs").
I've tried the following but nothing happens :
var d1 = new Date('JUN-2016')
var d2 = new Date(<% =session("month")+"-"+session("yrs") %>) )
if(d2.getTime() > d2.getTime())
{
alert('Greater than jun 2016');
}
else
{
alert('Less than jun 2016');
}
I've gone through this link Compare two dates with JavaScript but didn't find the solution for my condition.
As this application is developed on VB so i don't have much knowledge about that.
How can I resolve this .
Please suggest
Thanks in advance.