I'm using the Angular Bootstrap DateTimePicker.
I'm trying to figure out how to disable specific dates, but nothing is working.
Does anybody have any suggestions?
I'm using the Angular Bootstrap DateTimePicker.
I'm trying to figure out how to disable specific dates, but nothing is working.
Does anybody have any suggestions?
This works for me with the Dale Lotts DateTimePicker.
$scope.beforeRender = function ($view, $dates, $leftDate, $upDate, $rightDate) {
var nowUtc = new Date();
if ($view === 'day') {
nowUtc.setHours(0, 0, 0, 0);
} else {
if ($view === 'hour') {
nowUtc.setMinutes(0, 0, 0);
}
}
for (var i = 0; i < $dates.length; i++) {
if ($dates[i].utcDateValue < nowUtc) {
$dates[i].selectable = false;
} else {
$dates[i].selectable = true;
}
}
}