Please note that currently in the new version (starting from version 1.1.0) from AngularUI Bootstrap you should use the datepicker-options attribute to disable the date, as well as things like max / min date.
in the html control add
datepicker-options="vm.dateOptions"
or datepicker-options="dateOptions" if you are not using controller as , but $scope directly.
Then in your controller define a dateOptions object.
vm.dateOptions = { maxDate: new Date(), dateDisabled: myDisabledDates }; function myDisabledDates(dateAndMode) { return ( dateAndMode.mode === 'day' && ( dateAndMode.date.getDay() === 0 || dateAndMode.date.getDay() === 6 ) ); }
!!! Note!!! The signature function dateDisabled has changed. Previously, it takes a date object and a mode line. In a newer version, this is a wrapped object containing both.
Leon li
source share