Fix bug with default date input

When the input isn't touched by the user, the date isn't stored as an
array on the property.
This commit is contained in:
2019-08-02 16:58:12 +02:00
parent 5b47ba9e11
commit e4a39ec67c
+5 -1
View File
@@ -50,7 +50,11 @@ export default Component.extend({
} }
const attributes = this.getProperties(Object.keys(this.attributes)); const attributes = this.getProperties(Object.keys(this.attributes));
const [ date, time ] = attributes.date[0].toISOString().split('T');
let dateInput = (attributes.date instanceof Array) ?
attributes.date[0] : attributes.date;
const [ date, time ] = dateInput.toISOString().split('T');
[ attributes.date, attributes.time ] = [ date, time ]; [ attributes.date, attributes.time ] = [ date, time ];
this.set('inProgress', true); this.set('inProgress', true);