I have 2 different times. Now I want to compare these 2 times which are of the same date. I want to check which is the greater time. How can I do that. This is my code:
start_time = 10:30 AM
end_time = 12:30 PM
function modify_time(){
var start_time = $('#start_time').val();
var end_time = $('#end_time').val();
if (start_time != '' && end_time != '') {
alert(start_time); alert(end_time);
if (end_time <= start_time) {
alert('select valid time');
$('#start_time').val('');
$('#end_time').val('');
}
}
}
Thank You.