I am using a angular bootstrap datetimepicker from https://github.com/dalelotts/angular-bootstrap-datetimepicker. I want to set the available select day from today and today + 7. In the order words, disabled all other day. Any suggestions will be appreciated. Thanks.
1 Answers
0
votes
Yes, you can use the before-render callback to disable any dates that are out of range.
There is an example in the demo page.
Something like this should work (not tested at all)
function renderOnBeforeRender($dates) {
var now = moment.valueOf();
var max = moment().add('day', 7).valueOf();
angular.forEach($dates, function (dateObject) {
dateObject.selectable = (dateObject.localDateValue() >= now && dateObject.localDateValue() <= max)
});
}