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

Commit 5693388

Browse files
authored
Merge pull request #101 from panvourtsis/master
Optional parameter moment to avoid define it as global
2 parents 3ef5332 + 4f34ac9 commit 5693388

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

dist/multipleDatePicker.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,13 @@
130130
* Number of years from scope.month to show in future in select
131131
* note : will change year into a select
132132
*/
133-
changeYearFuture: '=?'
133+
changeYearFuture: '=?',
134+
135+
/*
136+
* Type: function
137+
* The moment object with functions. Optional if you dont want it on the global scope
138+
*/
139+
moment: '=?',
134140
},
135141
template: '<div class="multiple-date-picker">' +
136142
'<div class="picker-top-row">' +
@@ -150,7 +156,7 @@
150156
'</div>' +
151157
'</div>',
152158
link: function (scope) {
153-
159+
var moment = moment || scope.moment;
154160
scope.ngModel = scope.ngModel || [];
155161

156162
/*utility functions*/

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.

multipleDatePicker.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,13 @@
130130
* Number of years from scope.month to show in future in select
131131
* note : will change year into a select
132132
*/
133-
changeYearFuture: '=?'
133+
changeYearFuture: '=?',
134+
135+
/*
136+
* Type: function
137+
* The moment object with functions. Optional if you dont want it on the global scope
138+
*/
139+
moment: '=?',
134140
},
135141
template: '<div class="multiple-date-picker">' +
136142
'<div class="picker-top-row">' +
@@ -150,7 +156,7 @@
150156
'</div>' +
151157
'</div>',
152158
link: function (scope) {
153-
159+
var moment = moment || scope.moment;
154160
scope.ngModel = scope.ngModel || [];
155161

156162
/*utility functions*/

0 commit comments

Comments
 (0)