Skip to content

Commit 307dca7

Browse files
authored
Merge pull request #8 from IbrahimHd/master
adding minDate & maxDate optional attrs
2 parents 50cc1b7 + ac22243 commit 307dca7

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/date-input.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
'active': calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).startOf('day').isSame(selected.clone().startOf('day')),
2828
'inactive': calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).month() !== calendar.month()
2929
}"
30+
ng-disabled="(!!minDate && calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).date().isBefore(minDate.date())) || (!!maxDate && calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).date().isAfter(maxDate.date()))"
3031
ng-click="update(selected.clone().year(calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).year()).month(calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).month()).date(calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).date()), true)"
3132
ng-bind="calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).date()"></span>
3233
</div>

src/date-input.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ directive('dateInput', ['$document', function ($document) {
1313
onChange: '&',
1414
placeholder: '@',
1515
cssClass:'@',
16+
minDate:'=?',
17+
maxDate:'=?',
1618
},
1719
replace: true,
1820
templateUrl: './date-input.html',

0 commit comments

Comments
 (0)