Bootstrap Datetimepicker Startdate Does Not Disable Past Dates
I use bootstrap datetimepicker and I want to disable the past days but startDate option did not work: var now = new Date(); var tomorrow = now.getFullYear() + '-' + (now.getMonth()
Solution 1:
You probably need to use the minDate
option of the datetimepicker:
var tomorrow = newDate();
tomorrow.setDate(tomorrow.getDate() + 1);
$("#end_at").datetimepicker({
format: 'YYYY-MM-DD HH:mm:ss',
minDate: tomorrow
});
Solution 2:
It's been a long time. The option minDate
is deprecated. the new one is startDate
So you can use:
<scripttype="text/javascript">
$(".form_datetime").datetimepicker({
format: "dd MM yyyy - hh:ii",
autoclose: true,
todayBtn: true,
startDate: "2013-02-14 10:00",
minuteStep: 10
});
</script>
Solution 3:
startDate api will helps to disable past date
<scripttype="text/javascript">
$(function() {
$(".dates").datepicker({
format:'dd-mm-yyyy',
startDate:newDate(),
autoclose:true
});
</script>
Post a Comment for "Bootstrap Datetimepicker Startdate Does Not Disable Past Dates"