Skip to content
This repository was archived by the owner on Feb 18, 2022. It is now read-only.

Commit 33c8d3c

Browse files
author
Luke Pommersheim
committed
added dateMaxLimit to isolated scope and settup $watch on it.
1 parent 99caac8 commit 33c8d3c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/js/angular-datepicker.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
'scope': {
1414
'dateSet': '@',
1515
'dateMinLimit': '@',
16+
'dateMaxLimit': '@'
1617
},
1718
'link': function linkingFunction($scope, element, attr) {
1819
//get child input
@@ -24,8 +25,8 @@
2425
, prevButton = attr.buttonPrev || defaultPrevButton
2526
, nextButton = attr.buttonNext || defaultNextButton
2627
, dateFormat = attr.dateFormat
27-
, dateMaxLimit = attr.dateMaxLimit || undefined
2828
, dateMinLimit
29+
, dateMaxLimit
2930
, date = new Date()
3031
, isMouseOn = false
3132
, isMouseOnInput = false
@@ -98,6 +99,12 @@
9899
}
99100
});
100101

102+
$scope.$watch('dateMaxLimit', function (value) {
103+
if (value) {
104+
dateMaxLimit = value;
105+
}
106+
});
107+
101108
$scope.month = $filter('date')(date, 'MMMM');//December-November like
102109
$scope.monthNumber = Number($filter('date')(date, 'MM')); // 01-12 like
103110
$scope.day = Number($filter('date')(date, 'dd')); //01-31 like

0 commit comments

Comments
 (0)