Skip to content
This repository was archived by the owner on Sep 15, 2021. It is now read-only.

Commit 8bd7637

Browse files
committed
Fix default setting of datepicker options
Datepicker `date` and `mode` options were not being set if any truthy value was provided for options.
1 parent 6463412 commit 8bd7637

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/plugins/datepicker.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ angular.module('ngCordova.plugins.datePicker', [])
88
return {
99
show: function (options) {
1010
var q = $q.defer();
11-
options = options || {date: new Date(), mode: 'date'};
11+
options = angular.extend({
12+
date: new Date(),
13+
mode: 'date',
14+
}, options);
1215
$window.datePicker.show(options, function (date) {
1316
q.resolve(date);
1417
}, function (error){
@@ -17,4 +20,4 @@ angular.module('ngCordova.plugins.datePicker', [])
1720
return q.promise;
1821
}
1922
};
20-
}]);
23+
}]);

0 commit comments

Comments
 (0)