Problem Statement :
I have to validate a form having fields ‘Start Date’ and ‘End Date’.
Validation Constraint :
Difference between these two dates must not be less than 24 hours.
Example:
Invalid case :
SDate : “01-10-2012 11:59”
EDate : “”02-10-2012 00:00”
SDate : “01-10-2012 02:20”
EDate : “”02-10-2012 02:00”
Valid Case :
SDate : “01-10-2012 02:20”
EDate : “”02-10-2012 03:30”
Note : These two date objects have time value also.
Once you have parsed the 2 strings and created the corresponding
Dateobject, you only have to use :