Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
fix(datepicker): correctly set minMode/maxMode
Browse files Browse the repository at this point in the history
- Correctly set `minMode` and `maxMode` for the datepicker popup

Closes #5093
Fixes #5090
  • Loading branch information
wesleycho committed Dec 18, 2015
1 parent 3845980 commit 1524080
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/datepicker/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,16 @@ function(scope, element, attrs, $compile, $parse, $document, $rootScope, $positi
});
}

angular.forEach(['minMode', 'maxMode', 'minDate', 'maxDate', 'datepickerMode', 'initDate', 'shortcutPropagation'], function(key) {
angular.forEach(['minMode', 'maxMode'], function(key) {
if (attrs[key]) {
scope.$parent.$watch(function() { return attrs[key]; }, function(value) {
scope.watchData[key] = value;
});
datepickerEl.attr(cameltoDash(key), 'watchData.' + key);
}
});

angular.forEach(['minDate', 'maxDate', 'datepickerMode', 'initDate', 'shortcutPropagation'], function(key) {
if (attrs[key]) {
var getAttribute = $parse(attrs[key]);
scope.$parent.$watch(getAttribute, function(value) {
Expand Down

0 comments on commit 1524080

Please sign in to comment.