Guys,
below code worked for me but, with multiple challenges.
a) If startdate input is echoing from DB, enddate should not display days before the startdate but below code dose not do it. any support is appreciated.
Code:
<script>
$(document).ready(function() {
$ (".startdate").datetimepicker({
showSecond: true,
dateFormat:'yy-mm-dd',
timeFormat: 'HH:mm:ss',
numberOfMonths: 2,
stepHour: 1,
stepMinute: 1,
stepSecond: 1,
onSelect: function(selected) {
$(".enddate").datetimepicker("option","minDate", selected)
}
});
$(".enddate").datetimepicker({
showSecond: true,
dateFormat:'yy-mm-dd',
timeFormat: 'HH:mm:ss',
numberOfMonths: 2,
stepHour: 1,
stepMinute: 1,
stepSecond: 1,
onSelect: function(selected) {
$(".startdate").datetimepicker("option","maxDate", selected)
}
});
});
</script>