mirror of
https://github.com/discourse/discourse.git
synced 2025-02-17 01:22:44 +08:00
FIX: Local dates showed incorrect timezones with extra whitespace (#11408)
You might wonder why this matters. It turns out in some locales like French, we replace quotation marks with « and » -- this should likely not happen before BBCode is parsed but that is not the case for this plugin. The plugin has code to handle this situation, but it means extra spaces are inserted around the time zone which breaks it. This fix allows us to supply extra whitespace and will show the correct time zone.
This commit is contained in:
parent
812d047c60
commit
76b04afca3
|
@ -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;
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue
Block a user