This is my jQuery code. In this code #StartTime
and #EndTime
is form input tag id's.
The getting time format is 00:00 AM/PM.
The var starttimeval and endtimeval contain values of getting start and end time.
How do I compare these two times, example: if(starttimeval < endtimeval){alert(message);}
$(function() {
$('#StartTime').datetimepicker({
datepicker : false,
format : 'g:i A'
});
$('#EndTime').datetimepicker({
datepicker : false,
format : 'g:i A'
});
var starttimeval= $("#StartTime").val();
var endtimeval= $("#EndTime").val();
});
i want only time compare functionality. example getting value of starttimeval=8:00 PM and endtimeval=9:00 AM
starttimeval
andendtimeval
look like?The getting time format is 00:00 AM/PM.
23:00
always more than01:00
?