151
rated 0 times
[
155]
[
4]
/ answers: 1 / hits: 17491
/ 12 Years ago, thu, december 27, 2012, 12:00:00
I want to validate start time and end time selected using timepicker which is in 12 hr format. The end time should be greater than the start time. I used an if
statement but when the test is using values such as 8:00 AM as start time and 1:00 PM as end time, it is not working. What can I do to solve this problem. Someone please help me with this. I am stuck with this since yesterday. I want just time ,i don't need date.
$(#dateTimeAddButton).click(function ()
{
var Date=$('#myDatePickerId').val()
var startTime = $('#i').val();
var endTime = $('#i1').val();
if (startTime > endTime)
{
alert('End time always greater then start time.');
}
});
More From » jquery