From 6e3a2197f8a3db005bd3388709d547d82c20ac80 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Thu, 5 Jul 2018 10:58:53 +0200 Subject: [PATCH] FIX: removes UTC conversion when date and no time --- .../components/discourse-local-dates-create-form.js.es6 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/discourse-local-dates/assets/javascripts/discourse/components/discourse-local-dates-create-form.js.es6 b/plugins/discourse-local-dates/assets/javascripts/discourse/components/discourse-local-dates-create-form.js.es6 index 95c8547ab80..c833c81a1bc 100644 --- a/plugins/discourse-local-dates/assets/javascripts/discourse/components/discourse-local-dates-create-form.js.es6 +++ b/plugins/discourse-local-dates/assets/javascripts/discourse/components/discourse-local-dates-create-form.js.es6 @@ -100,14 +100,14 @@ export default Ember.Component.extend({ if (time) { dateTime = moment(`${date} ${time}`, this.dateTimeFormat).utc(); } else { - dateTime = moment(date, this.dateFormat).utc(); + dateTime = moment(date, this.dateFormat).startOf("day"); } let toDateTime; if (toTime) { toDateTime = moment(`${toDate} ${toTime}`, this.dateTimeFormat).utc(); } else { - toDateTime = moment(toDate, this.dateFormat).utc(); + toDateTime = moment(toDate, this.dateFormat).endOf("day"); } let config = {