This is my script.
$(document).on("click","input[name='to_time[]']",function(){
var from = $("input[name='from_time[]']").val(); // "11:15 AM"
var to = $("input[name='to_time[]']").val(); //"10:15 AM"
if(Date.parse(from) > Date.parse(to)){
alert("Invalid Date Range");
}
});
From Datepicker receiving date as this format "12:54 PM" Date.parse(from) returning as Not a number. NaN How do I parse this string to Javascript object or is there any alternative way to validate End time and From time.