From fb51b6f736fcd71af4bd97c26558920d19f11a4a Mon Sep 17 00:00:00 2001 From: Riley Ho Date: Mon, 27 May 2024 21:15:42 +0800 Subject: [PATCH] feat: change default time zone the conference time --- locales/en/session.json | 2 +- locales/zh-TW/session.json | 2 +- src/pages/Session.vue | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/locales/en/session.json b/locales/en/session.json index b3f387623f8e..fcbde4b1f0b1 100644 --- a/locales/en/session.json +++ b/locales/en/session.json @@ -17,7 +17,7 @@ }, "time_zone": { "select_label": "Time Zone: ", - "reset_button": "Reset to local time" + "reset_button": "Reset to conference time" }, "share_title": "The sessions I would like to attend at COSCUP {year}.", "share_copied": "Copy URL successfully.", diff --git a/locales/zh-TW/session.json b/locales/zh-TW/session.json index f3fc94b69798..6987d3b89561 100644 --- a/locales/zh-TW/session.json +++ b/locales/zh-TW/session.json @@ -17,7 +17,7 @@ }, "time_zone": { "select_label": "時區:", - "reset_button": "重設為當地時間" + "reset_button": "重設為會場時間" }, "share_title": "COSCUP {year} 我想聽的議程們", "share_copied": "複製網址成功", diff --git a/src/pages/Session.vue b/src/pages/Session.vue index 757964cd17e5..a0fcb158c8fc 100644 --- a/src/pages/Session.vue +++ b/src/pages/Session.vue @@ -18,7 +18,7 @@ /> @@ -96,12 +96,12 @@ export default defineComponent({ value: timeZone, text: timeZone })) - const deviceTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone + const defaultTimeZone = 'Asia/Taipei' // Time zone of the event const storedTimeZone = localStorage.getItem('timeZone') - const currentTimeZone = ref(storedTimeZone ?? deviceTimezone) + const currentTimeZone = ref(storedTimeZone ?? defaultTimeZone) const resetTimeZone = () => { - currentTimeZone.value = deviceTimezone + currentTimeZone.value = defaultTimeZone localStorage.removeItem('timeZone') } @@ -182,7 +182,7 @@ export default defineComponent({ route, timeZoneOptions, currentTimeZone, - deviceTimezone, + defaultTimeZone, resetTimeZone, TIMEZONE_OFFSET }