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

Commit 6cc800d

Browse files
committed
add customParser support
1 parent 6e6c7b9 commit 6cc800d

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
var self = this;
@@ -119,13 +122,16 @@ export default Ember.Mixin.create({
119122
var self = this,
120123
element = this.$(),
121124
value = this.get('value'),
125+
customParser = this.get('customParser'),
122126
dates = [];
123127

124128
if (!this.get('mustUpdateInput')) {
125129
this.set('mustUpdateInput', true);
126130
return;
127131
}
128132

133+
value = customParser(value);
134+
129135
switch (Ember.typeOf(value)) {
130136
case 'array':
131137
dates = value;

0 commit comments

Comments
 (0)