From db64a101b060f6a5d7b31b744e9e0029e5d28bb7 Mon Sep 17 00:00:00 2001 From: Alys Date: Sat, 21 Mar 2020 19:24:24 +1000 Subject: [PATCH] add time zones to timestamp/authentication section --- .../client/src/components/admin-panel/index.vue | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/website/client/src/components/admin-panel/index.vue b/website/client/src/components/admin-panel/index.vue index 016a711825..99ac8f7e93 100644 --- a/website/client/src/components/admin-panel/index.vue +++ b/website/client/src/components/admin-panel/index.vue @@ -100,7 +100,7 @@ :class="{'open': expandAuth}" @click="expandAuth = !expandAuth" > - Timestamps, Authentication, Email Address + Timestamps, Time Zone, Authentication, Email Address
Account created: @@ -113,6 +113,15 @@ {{ formatDate(hero.lastCron) }} (if different than above, cron crashed before finishing)
+
Time zone: + {{ formatTimeZone(hero.preferences.timezoneOffset) }} +
+
Time zone at previous cron: + {{ formatTimeZone(hero.preferences.timezoneOffsetAtLastCron) }} +
(if different than above, the user changed zones / daylight savings + OR has devices on different zones OR uses a VPN with varying zones + OR something similarly unpleasant is happening) +
Local authentication: Yes,   {{ hero.auth.local.email }} @@ -404,6 +413,11 @@ export default { const date = moment(inputDate).utcOffset(0).format('YYYY-MM-DD HH:mm'); return `${date} UTC`; }, + formatTimeZone (inputTimeZoneOffset) { + const timeZone = (inputTimeZoneOffset / 60) * -1; + const sign = (timeZone < 0) ? '-' : '+'; + return `${sign}${timeZone} UTC`; + }, formatEquipment (gearWorn) { const gearTypes = ['head', 'armor', 'weapon', 'shield', 'headAccessory', 'eyewear', 'body', 'back'];