Open tpetrone opened 5 years ago
I would like to share the workaround we are using. Please share your thoughts.
custom-paper-pikaday.js
import moment from 'moment';
import layout from 'ember-paper/templates/components/paper-input';
import PikadayInput from 'ember-paper-pikaday/components/paper-pikaday';
export default PikadayInput.extend({
layout,
// Override method of PikadayMixin from ember-pikaday
setPikadayDate() {
const format = this.get('format');
const value = this.get('value');
if (!value) {
this.get('pikaday').setDate(value, true);
} else {
const date = this.get('useUTC')
? moment.utc(moment(value, format).format('YYYY-MM-DD')).toDate()
: moment(value, format).toDate();
this.get('pikaday').setDate(date, true);
}
},
});
Behaviour:
Expected: