1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 1× | angular.module('datepickerBasicUsage', ['ngMaterial', 'ngMessages']).controller('AppCtrl', function($scope) { $scope.myDate = new Date(); $scope.minDate = new Date( $scope.myDate.getFullYear(), $scope.myDate.getMonth() - 2, $scope.myDate.getDate()); $scope.maxDate = new Date( $scope.myDate.getFullYear(), $scope.myDate.getMonth() + 2, $scope.myDate.getDate()); $scope.onlyWeekendsPredicate = function(date) { var day = date.getDay(); return day === 0 || day === 6; }; }); |