This is my script.
$(document).on("click","input[name='to_time[]']",function(){
var from = $("input[name='from_time[]']").val();
var to = $("input[name='to_time[]']").val();
if(Date.parse(from) > Date.parse(to)){
alert("Invalid Date Range");
}
});
From the date of receipt Datepicker in this format "12:54 PM" Date.parse (from) returns as not a number. NaN How to parse this string into a Javascript object, or is there an alternative way to check the end time and time.
source
share