Possible Duplicate:
Compare dates with JavaScript
I have two dates, start date and end date. I am comparing them like this:
var fromDate = $("#fromDate").val();
var throughDate = $("#throughDate").val();
if (startdate >= enddate) {
alert('start date cannot be greater then end date')
}
It gives the correct result... the only problem is when I compare the dates 01/01/2013 and 01/01/2014.
How can I correctly compare dates in JavaScript?