diff --git a/src/datepicker/datepicker.js b/src/datepicker/datepicker.js index f6df0f9536..e949ead335 100644 --- a/src/datepicker/datepicker.js +++ b/src/datepicker/datepicker.js @@ -1013,11 +1013,17 @@ function($scope, $element, $attrs, $compile, $log, $parse, $window, $document, $ $scope.isDisabled = function(date) { if (date === 'today') { - date = new Date(); + date = dateParser.fromTimezone(new Date(), ngModelOptions.timezone); + } + + if ($scope.datepickerOptions) { + return $scope.datepickerOptions && + $scope.datepickerOptions.minDate && $scope.compare(date, $scope.datepickerOptions.minDate) < 0 || + $scope.datepickerOptions.maxDate && $scope.compare(date, $scope.datepickerOptions.maxDate) > 0; } return $scope.watchData.minDate && $scope.compare(date, cache.minDate) < 0 || - $scope.watchData.maxDate && $scope.compare(date, cache.maxDate) > 0; + $scope.watchData.maxDate && $scope.compare(date, cache.maxDate) > 0; }; $scope.compare = function(date1, date2) {