Through the form i am getting two values like
Start datetime = '01/12/2013 12:00:00 AM' and
End datetime = '02/12/2013 12:00:00 AM'.
How I can validate the start datetime must be less than end datetime in javascript?
Through the form i am getting two values like
Start datetime = '01/12/2013 12:00:00 AM' and
End datetime = '02/12/2013 12:00:00 AM'.
How I can validate the start datetime must be less than end datetime in javascript?
Asuming you received a date in Javascript Date format you need
Date.parse()
function or compare by comparison operators. It will return the milliseconds that have passed since 01/01/1970 00:00Somehow like this:
Here is a Fiddle
use the date object
Here we are splitting the date and then combining it for comparing it hope it will work thanks.....:)
Try this following code:
its really simple in javascript
and then all you need to do is compare
More on this here