问题
I want to disable past dates & current date, but I'm unable to disable current date. Below my code, only disables past dates, please correct my code if I'm wrong, thanks in advance.
<script>
$('#datetimepicker1').datetimepicker({
minDate: moment(1, 'h')
});
</script>
回答1:
Try disabledDates with minDate:
$('#datetimepicker').datetimepicker({
minDate:new Date(),
disabledDates: [new Date()]
});
Fiddle
回答2:
use the minDate and disabledDates:
$('#datetimepicker').datetimepicker({
minDate:new Date(),
disabledDates: [new Date()]
});
来源:https://stackoverflow.com/questions/43610281/bootstrap-datetimepicker-disable-past-dates-current-date