How can I add a minimum of days based on hour in datetimepicker?
问题 My code javascript like this : $(function () { $('#datepicker').datetimepicker({ minDate: moment().startOf('day') }).on('dp.change', function(e){ if( e.date && e.date.isSame(moment(), 'd') ){ var min = moment().startOf('minute').add(300, 'm'); $('#timepicker').data("DateTimePicker").minDate(min); } else { $('#timepicker').data("DateTimePicker").minDate(false); } }); $('#timepicker').datetimepicker({ minDate: moment().startOf('minute').add(300, 'm'), }); }); Demo and full code like this :