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

Commit f6b402b

Browse files
committed
add DatesDisabled to allow user block some dates
1 parent f369eb9 commit f6b402b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

addon/components/datepicker-support.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ export default Ember.Mixin.create({
3434
todayBtn: this.get('todayBtn'),
3535
todayHighlight: this.get('todayHighlight'),
3636
toggleActive: this.get('toggleActive'),
37-
weekStart: this.get('weekStart')
37+
weekStart: this.get('weekStart'),
38+
datesDisabled: this.get('datesDisabled')
3839
}).
3940
on('changeDate', function(event) {
4041
Ember.run(function() {
@@ -89,6 +90,12 @@ export default Ember.Mixin.create({
8990
this._updateDatepicker();
9091
}),
9192

93+
_updateDatesDisabled: Ember.observer('datesDisabled', function() {
94+
this.$().datepicker('setDatesDisabled', this.get('datesDisabled'));
95+
this._updateDatepicker();
96+
}),
97+
98+
9299
_updateDatepicker: function() {
93100
var self = this,
94101
element = this.$(),

0 commit comments

Comments
 (0)