FIX: removes UTC conversion when date and no time

This commit is contained in:
Joffrey JAFFEUX 2018-07-05 10:58:53 +02:00 committed by GitHub
parent dc04892a2d
commit 6e3a2197f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -100,14 +100,14 @@ export default Ember.Component.extend({
if (time) { if (time) {
dateTime = moment(`${date} ${time}`, this.dateTimeFormat).utc(); dateTime = moment(`${date} ${time}`, this.dateTimeFormat).utc();
} else { } else {
dateTime = moment(date, this.dateFormat).utc(); dateTime = moment(date, this.dateFormat).startOf("day");
} }
let toDateTime; let toDateTime;
if (toTime) { if (toTime) {
toDateTime = moment(`${toDate} ${toTime}`, this.dateTimeFormat).utc(); toDateTime = moment(`${toDate} ${toTime}`, this.dateTimeFormat).utc();
} else { } else {
toDateTime = moment(toDate, this.dateFormat).utc(); toDateTime = moment(toDate, this.dateFormat).endOf("day");
} }
let config = { let config = {