if I have 4 variables
startTime;
endTime;
startMerid;
endMerid;
startMarid and endMarid are either going to be ‘AM’ or ‘PM’.
but startTime and endTime are going to be strings like ‘dd:dd’
so it may be start:12:30 PM and end:5:30 PM
How can I validate that the end time is not before the start time?
Thanks!!
You can use DateJS:
EDIT:
Justin has a good point below. You can find the latest en-US version here
You can find the others in /trunk/build
EDIT 2016:
For those hitting this post in 2016+, it looks like a more up to date repo for DateJS is now at GitHub: https://github.com/datejs/Datejs
Also, it seems MomentJS is a very popular choice these days.