Skip to content

Commit

Permalink
feat: change default time zone the conference time
Browse files Browse the repository at this point in the history
  • Loading branch information
rileychh committed May 27, 2024
1 parent 7f72694 commit fb51b6f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion locales/en/session.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
2 changes: 1 addition & 1 deletion locales/zh-TW/session.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"time_zone": {
"select_label": "時區:",
"reset_button": "重設為當地時間"
"reset_button": "重設為會場時間"
},
"share_title": "COSCUP {year} 我想聽的議程們",
"share_copied": "複製網址成功",
Expand Down
10 changes: 5 additions & 5 deletions src/pages/Session.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/>
<button
@click="resetTimeZone"
:class="{ available: currentTimeZone !== deviceTimezone }"
:class="{ available: currentTimeZone !== defaultTimeZone }"
>{{ t('session.time_zone.reset_button') }}</button
>
</div>
Expand Down Expand Up @@ -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')
}

Expand Down Expand Up @@ -182,7 +182,7 @@ export default defineComponent({
route,
timeZoneOptions,
currentTimeZone,
deviceTimezone,
defaultTimeZone,
resetTimeZone,
TIMEZONE_OFFSET
}
Expand Down

0 comments on commit fb51b6f

Please sign in to comment.