From 6d0ba74b9808c2b5cf5e4a64e9d5e8907627172d Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Wed, 8 Apr 2020 11:43:47 +0200 Subject: [PATCH] UX: Ensures timezone is used over localTimezone when displaying dates --- .../assets/javascripts/lib/local-date-builder.js.es6 | 2 +- .../test/javascripts/lib/local-date-builder-test.js.es6 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/discourse-local-dates/assets/javascripts/lib/local-date-builder.js.es6 b/plugins/discourse-local-dates/assets/javascripts/lib/local-date-builder.js.es6 index 578bd7a330a..b424d38590b 100644 --- a/plugins/discourse-local-dates/assets/javascripts/lib/local-date-builder.js.es6 +++ b/plugins/discourse-local-dates/assets/javascripts/lib/local-date-builder.js.es6 @@ -32,7 +32,7 @@ export default class LocalDateBuilder { displayedTimezone = this.displayedTimezone || this.localTimezone; } else { displayedTimezone = - this.displayedTimezone || this.localTimezone || this.timezone; + this.displayedTimezone || this.timezone || this.localTimezone; } let localDate = new DateWithZoneHelper({ diff --git a/plugins/discourse-local-dates/test/javascripts/lib/local-date-builder-test.js.es6 b/plugins/discourse-local-dates/test/javascripts/lib/local-date-builder-test.js.es6 index a27d319eefc..b18e63632fc 100644 --- a/plugins/discourse-local-dates/test/javascripts/lib/local-date-builder-test.js.es6 +++ b/plugins/discourse-local-dates/test/javascripts/lib/local-date-builder-test.js.es6 @@ -81,7 +81,7 @@ QUnit.test("option[format]", assert => { freezeTime({ date: "2020-03-11" }, () => { assert.buildsCorrectDate( { format: "YYYY" }, - { formated: "2020" }, + { formated: "2020 (UTC)" }, "it uses custom format" ); });