I have two date fields start date and end date which I want to validate such that end date cannot be lesser than the start date.The dates are in YYYY:MM

D HH:MM

S format.For comparing I first parse the dates using Date.parse() and then compare using .getTime() method.It doesn't work.When I used an alert I get something called NaN.
Please advice.Where I am going wrong?