FIX: CurrentUser now must be passed to resolveTimezone and user card local time issues (#9734)

* This is to prevent user's timezones being changed accidentally
e.g. by admin looking at a user
* This problem only occurred via the user card, however the user card
was still calling userTimezone even if the setting to display user
time in card was disabled
This commit is contained in:
Martin Brennan
2020-05-11 11:01:47 +10:00
committed by GitHub
parent 44712c5f98
commit 12d4d51d81
10 changed files with 78 additions and 21 deletions
@@ -114,7 +114,9 @@ QUnit.test(
function(assert) {
let dt = moment.tz(
"2019-12-11T11:37:16",
BookmarkController.currentUser.resolvedTimezone()
BookmarkController.currentUser.resolvedTimezone(
BookmarkController.currentUser
)
);
assert.equal(
@@ -208,7 +210,9 @@ QUnit.test(
moment
.tz(
"2028-12-12 08:00",
BookmarkController.currentUser.resolvedTimezone()
BookmarkController.currentUser.resolvedTimezone(
BookmarkController.currentUser
)
)
.toString(),
"the custom date and time are parsed correctly with default time"