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

Commit 1524080

Browse files
committed
fix(datepicker): correctly set minMode/maxMode
- Correctly set `minMode` and `maxMode` for the datepicker popup Closes #5093 Fixes #5090
1 parent 3845980 commit 1524080

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Diff for: src/datepicker/datepicker.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,16 @@ function(scope, element, attrs, $compile, $parse, $document, $rootScope, $positi
642642
});
643643
}
644644

645-
angular.forEach(['minMode', 'maxMode', 'minDate', 'maxDate', 'datepickerMode', 'initDate', 'shortcutPropagation'], function(key) {
645+
angular.forEach(['minMode', 'maxMode'], function(key) {
646+
if (attrs[key]) {
647+
scope.$parent.$watch(function() { return attrs[key]; }, function(value) {
648+
scope.watchData[key] = value;
649+
});
650+
datepickerEl.attr(cameltoDash(key), 'watchData.' + key);
651+
}
652+
});
653+
654+
angular.forEach(['minDate', 'maxDate', 'datepickerMode', 'initDate', 'shortcutPropagation'], function(key) {
646655
if (attrs[key]) {
647656
var getAttribute = $parse(attrs[key]);
648657
scope.$parent.$watch(getAttribute, function(value) {

0 commit comments

Comments
 (0)