I am using jquery date time picker and using start date and end date.
When selecting same date for start date and end date I do not want it to allow the end date time to be less than start date time. How would I adjust my code?
$( "#fdate" ).datetimepicker({
dateFormat: 'yy-mm-dd',timeFormat: 'HH:mm:ss',
onClose: function( selectedDate ) {
$( "#tdate" ).datetimepicker( "option", "minDate", selectedDate );
}
}).attr('readonly', 'readonly');
$( "#tdate" ).datetimepicker({dateFormat: 'yy-mm-dd',timeFormat: 'HH:mm:ss',
onClose: function( selectedDate ) {
$( "#fdate" ).datetimepicker( "option", "maxDate", selectedDate );
}
}).attr('readonly', 'readonly');
});
here fdate is start date and tdate is end date and here is Fiddle of the issue