tia_kamakshi
asked on
Validating dates in javascript
Hi Experts,
I wanted to compare dates in javascript. I have a dates in format
Above date validation works fine if we take dates in july, aug
but if we take dates in sep and oct it fails.
Please help making above condition works with calculating dates.
Thanks & Regards
I wanted to compare dates in javascript. I have a dates in format
// 18-Sep-2013
// 15-Oct-2013
if(document.getElementById("car_eventDate_from").value >= document.getElementById("car_eventDate_return").value)
{
}
WHERE
Value for document.getElementById("car_eventDate_from").value = 18-Sep-2013
Value for document.getElementById("car_eventDate_return").value = 15-Oct-2013
Above date validation works fine if we take dates in july, aug
but if we take dates in sep and oct it fails.
Please help making above condition works with calculating dates.
Thanks & Regards
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
http://jsfiddle.net/rjurd/RQQAa/
html:
Open in new window
javascript:
Open in new window