diff --git a/plugins/discourse-local-dates/assets/javascripts/lib/discourse-markdown/discourse-local-dates.js.es6 b/plugins/discourse-local-dates/assets/javascripts/lib/discourse-markdown/discourse-local-dates.js.es6 index 8ea3c13a4a1..09eba6c2535 100644 --- a/plugins/discourse-local-dates/assets/javascripts/lib/discourse-markdown/discourse-local-dates.js.es6 +++ b/plugins/discourse-local-dates/assets/javascripts/lib/discourse-markdown/discourse-local-dates.js.es6 @@ -25,7 +25,7 @@ function addLocalDate(buffer, matches, state) { config.format = parsed.attrs.format; config.calendar = parsed.attrs.calendar; config.time = parsed.attrs.time; - config.timezone = parsed.attrs.timezone; + config.timezone = (parsed.attrs.timezone || "").trim(); config.recurring = parsed.attrs.recurring; config.timezones = parsed.attrs.timezones; config.displayedTimezone = parsed.attrs.displayedTimezone; diff --git a/plugins/discourse-local-dates/test/javascripts/acceptance/local-dates-composer-test.js.es6 b/plugins/discourse-local-dates/test/javascripts/acceptance/local-dates-composer-test.js.es6 index 8e2e9820561..bd0b79426ce 100644 --- a/plugins/discourse-local-dates/test/javascripts/acceptance/local-dates-composer-test.js.es6 +++ b/plugins/discourse-local-dates/test/javascripts/acceptance/local-dates-composer-test.js.es6 @@ -16,7 +16,7 @@ acceptance("Local Dates - composer", function (needs) { await fillIn( ".d-editor-input", - '[date=2017-10-23 time=01:30:00 displayedTimezone="America/Chicago" format="LLLL" calendar="off" recurring="1.weeks" timezone="Asia/Calcutta" timezones="Europe/Paris|America/Los_Angeles"]' + '[date=2017-10-23 time=01:30:00 displayedTimezone="America/Chicago" format="LLLL" calendar="off" recurring="1.weeks" timezone=" Asia/Calcutta" timezones="Europe/Paris|America/Los_Angeles"]' ); assert.equal(getAttr("date"), "2017-10-23", "it has the correct date");