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

Commit 9a115bd

Browse files
committed
add customParser support
1 parent b810a20 commit 9a115bd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

addon/components/datepicker-support.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ export default Ember.Mixin.create({
99
language: undefined,
1010
startDate: undefined,
1111
endDate: undefined,
12+
customParser: function(value) {
13+
return value;
14+
},
1215

1316
setupBootstrapDatepicker: Ember.on('didInsertElement', function() {
1417

@@ -134,13 +137,16 @@ export default Ember.Mixin.create({
134137
_updateDatepicker: function() {
135138
var element = this.$(),
136139
value = this.get('value'),
140+
customParser = this.get('customParser'),
137141
dates = [];
138142

139143
if (!this.get('mustUpdateInput')) {
140144
this.set('mustUpdateInput', true);
141145
return;
142146
}
143147

148+
value = customParser(value);
149+
144150
switch (Ember.typeOf(value)) {
145151
case 'array':
146152
dates = value;

0 commit comments

Comments
 (0)