I want to disable selecting some hours with bootstrap datetimepicker because I want to select only time from 8:00 am to 19:00 pm.
I can't find nothing about that. Can you help me?
This should work:
$(".datepicker").datetimepicker({
hoursDisabled: '0,1,2,3,4,5,6,7,18,19,20,21,22,23'
});
and also this:
hoursDisabled: [0, 1, 2, 3, 4, 5, 6, 7, 8, 18, 19, 20, 21, 22, 23]
Because in bootstrap-datetimepicker.js:
setHoursDisabled: function (hoursDisabled) {
this.hoursDisabled = hoursDisabled || [];
if (!$.isArray(this.hoursDisabled)) {
this.hoursDisabled = this.hoursDisabled.split(/,\s*/);
}
...
},