I have page with 2 textfields (start time and end time) i am using HTML5 time element, now i want to validate start time is always lesser than end time, i am currently using below script to validate
function checkTimings(source, argument) {
var sTime = new Date("01/01/0001 " + $("[id$=txtStartTimings]").val());
var eTime = new Date("01/01/0001 " + $("[id$=txtEndTimings]").val());
argument.IsValid = sTime < eTime;
}
This work when the either both the timings are AM or PM but there's one case when the start time would be PM and end time would be AM like 11.45 PM to 12.15 AM, here the validation fails.
Could anyone suggest how we could handle this situation?