In a leave application form, there are two time fields ‘From’ and ‘To’. When I give say, 12:30 PM in From time field and 1:30 PM in To time field, validating result shows that ‘To’ time should be greater than ‘From’ time. Is there any simple validation (may be Regular Expression) available to validate this, so that it should accept this time in 12 hours format.
Any suggestions would be appreciable.
Thanks.
Make sure you are careful to handle the crossing day/week/month/year/… boundaries.
You might be interesteed in taking a look at http://infiniteundo.com/post/25326999628/falsehoods-programmers-believe-about-time