Possible Duplicate:
Compare 2 dates with JavaScript
Compare two dates in JavaScript
I am new to jQuery and I want to compare two dates,
e.g. var date1 = '2011-01-12';
var date2 = '2011-01-15';
I tried but could’t find a solution.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Because you’ve got the dates in a
YYYY-MM-DDformat, you can simply do string comparison;Aside from that, see the dupes.