Skip to content
This repository was archived by the owner on Aug 6, 2020. It is now read-only.

Commit 7a3d0ed

Browse files
author
Maelig GOHIN
committed
release: 2.0.11
1 parent 443ebbe commit 7a3d0ed

File tree

7 files changed

+137
-70
lines changed

7 files changed

+137
-70
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
#What's new ?
44

5+
###Version 2.0.11
6+
Fixed [#71](https://github.com/arca-computing/MultipleDatePicker/issues/71)
7+
58
###Version 2.0.10
69
Fixed [#70](https://github.com/arca-computing/MultipleDatePicker/pull/70)
710

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-multiple-date-picker",
3-
"version": "2.0.10",
3+
"version": "2.0.11",
44
"authors": [
55
"mgohin <mgohin@arca-computing.fr>"
66
],

dist/multipleDatePicker.js

Lines changed: 65 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
@author : Maelig GOHIN For ARCA-Computing - www.arca-computing.fr
3-
@version: 2.0.10
3+
@version: 2.0.11
44
55
@description: MultipleDatePicker is an Angular directive to show a simple calendar allowing user to select multiple dates.
66
Css style can be changed by editing less or css stylesheet.
@@ -195,37 +195,69 @@
195195
};
196196

197197
/*scope functions*/
198-
scope.$watch('ngModel', function () {
199-
scope.generate();
200-
}, true);
201-
202-
scope.$watch('month', function () {
203-
scope.generate();
204-
}, true);
205-
206-
scope.$watch('highlightDays', function () {
207-
scope.generate();
208-
}, true);
209-
210-
scope.$watch('weekDaysOff', function () {
211-
scope.generate();
212-
}, true);
213-
214-
scope.$watch('allDaysOff', function () {
215-
scope.generate();
216-
}, true);
217-
218-
scope.$watch('daysAllowed', function () {
219-
scope.generate();
220-
}, true);
221-
222-
scope.$watch(function () {
223-
return moment.locale();
224-
}, function () {
225-
scope.daysOfWeek = getDaysOfWeek();
226-
scope.monthToDisplay = getMonthYearToDisplay();
227-
}, true);
228-
198+
var watches = [];
199+
watches.push(
200+
scope.$watch('ngModel', function () {
201+
scope.generate();
202+
}, true)
203+
);
204+
205+
watches.push(
206+
scope.$watch('month', function () {
207+
scope.generate();
208+
}, true)
209+
);
210+
211+
watches.push(
212+
scope.$watch('highlightDays', function () {
213+
scope.generate();
214+
}, true)
215+
);
216+
217+
watches.push(
218+
scope.$watch('weekDaysOff', function () {
219+
scope.generate();
220+
}, true)
221+
);
222+
223+
watches.push(
224+
scope.$watch('allDaysOff', function () {
225+
scope.generate();
226+
}, true)
227+
);
228+
229+
watches.push(
230+
scope.$watch('daysAllowed', function () {
231+
scope.generate();
232+
}, true)
233+
);
234+
235+
watches.push(
236+
scope.$watch('disableDaysBefore', function () {
237+
scope.generate();
238+
}, true)
239+
);
240+
241+
watches.push(
242+
scope.$watch('disableDaysAfter', function () {
243+
scope.generate();
244+
}, true)
245+
);
246+
247+
watches.push(
248+
scope.$watch(function () {
249+
return moment.locale();
250+
}, function () {
251+
scope.daysOfWeek = getDaysOfWeek();
252+
scope.monthToDisplay = getMonthYearToDisplay();
253+
}, true)
254+
);
255+
256+
scope.$on('destroy', function () {
257+
for(var i = 0; i < watches.length; i++){
258+
watches[i]();
259+
}
260+
});
229261
//default values
230262
scope.month = scope.month || moment().startOf('day');
231263
scope.days = [];
@@ -266,7 +298,7 @@
266298
} else {
267299
var idx = -1;
268300
for (var i = 0; i < scope.ngModel.length; ++i) {
269-
if (scope.ngModel[i].isSame(day.date,'day')) {
301+
if (scope.ngModel[i].isSame(day.date, 'day')) {
270302
idx = i;
271303
break;
272304
}

dist/multipleDatePicker.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)