FIX: ensures pikaday picker is showing in UTC (#7968)

FIX: ensures pikaday picker is showing in UTC (#7968)

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 d6bce16..918f8fd 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
@@ -376,7 +376,6 @@ export default Ember.Component.extend({
           format: "YYYY-MM-DD",
           reposition: false,
           firstDay: 1,
-          defaultDate: moment(this.date, this.dateFormat).toDate(),
           setDefaultDate: true,
           keyboardInput: false,
           i18n: {
@@ -420,7 +419,7 @@ export default Ember.Component.extend({
     }
 
     Ember.run.schedule("afterRender", () => {
-      this._picker.setDate(date, true);
+      this._picker.setDate(moment.utc(date), true);
     });
   },

GitHub sha: f4543ff0

1 Like