mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: ensures preview is correctly computing timezone for current user (#9758)
This also fixes a related bug with timezones on displayed date when in calendar range.
This commit is contained in:
@ -298,6 +298,18 @@ QUnit.test("option[calendar]", assert => {
|
||||
"it stops formating out of calendar range"
|
||||
)
|
||||
);
|
||||
|
||||
freezeTime({ date: "2020-05-12", timezone: LOS_ANGELES }, () => {
|
||||
assert.buildsCorrectDate(
|
||||
{
|
||||
date: "2020-05-13",
|
||||
time: "18:00",
|
||||
localTimezone: LOS_ANGELES
|
||||
},
|
||||
{ formated: "Tomorrow 11:00 AM" },
|
||||
"it correctly displays a different local timezone"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
QUnit.test("previews", assert => {
|
||||
@ -467,4 +479,27 @@ QUnit.test("previews", assert => {
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
freezeTime({ date: "2020-05-12", timezone: LOS_ANGELES }, () => {
|
||||
assert.buildsCorrectDate(
|
||||
{
|
||||
date: "2020-05-13",
|
||||
time: "18:00",
|
||||
localTimezone: LOS_ANGELES
|
||||
},
|
||||
{
|
||||
previews: [
|
||||
{
|
||||
current: true,
|
||||
formated: "May 13, 2020 11:00 AM",
|
||||
timezone: "Los Angeles"
|
||||
},
|
||||
{
|
||||
formated: "May 13, 2020 6:00 PM",
|
||||
timezone: "UTC"
|
||||
}
|
||||
]
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user