Skip to content

Use device timezone in desktop renderer#121

Merged
Onatcer merged 3 commits into
solidtime-io:mainfrom
sdip15fa:fix/use-device-timezone
Jun 2, 2026
Merged

Use device timezone in desktop renderer#121
Onatcer merged 3 commits into
solidtime-io:mainfrom
sdip15fa:fix/use-device-timezone

Conversation

@sdip15fa
Copy link
Copy Markdown
Contributor

@sdip15fa sdip15fa commented Jun 2, 2026

Summary

  • use the macOS/device timezone as the desktop renderer timezone source
  • remove the hard-coded Europe/Vienna fallback from the desktop shell
  • keep the existing week-start behavior from /me

Fixes #120.

Verification

  • git diff --check
  • npx --yes prettier@3.3.2 --check src/renderer/src/App.vue

Full typecheck was not run because dependency installation is currently blocked by upstream package install issues:

  • npm ci reports package.json and package-lock.json are out of sync
  • npm install --package-lock=false reports a peer conflict between vue-router@5.1.0 and the app's Vite 6 dependency

Copilot AI review requested due to automatic review settings June 2, 2026 07:30
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jun 2, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a device-derived timezone getter and wires it into the renderer’s global settings accessors (via window.getTimezoneSetting), replacing the previous hardcoded/server-provided timezone behavior.

Changes:

  • Introduced getDeviceTimezone() using Intl.DateTimeFormat().resolvedOptions().timeZone with a UTC fallback.
  • Updated window.getTimezoneSetting initialization to use the device timezone instead of a hardcoded value.
  • Removed updating window.getTimezoneSetting from the meResponse watcher (while keeping the week-start wiring).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/renderer/src/App.vue Outdated
Comment on lines 71 to 81
function getDeviceTimezone() {
return Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC'
}

window.getTimezoneSetting = getDeviceTimezone

watch(meResponse, () => {
if (meResponse.value?.data) {
window.getTimezoneSetting = () => meResponse.value.data.timezone
window.getWeekStartSetting = () => meResponse.value.data.week_start
}
})
Comment thread src/renderer/src/App.vue Outdated
Comment on lines +71 to +73
function getDeviceTimezone() {
return Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC'
}
Comment thread src/renderer/src/App.vue Outdated
return Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC'
}

window.getTimezoneSetting = getDeviceTimezone
Comment thread src/renderer/src/App.vue Outdated

onMounted(async () => {
window.getTimezoneSetting = () => 'Europe/Vienna'
window.getTimezoneSetting = getDeviceTimezone
@sdip15fa sdip15fa force-pushed the fix/use-device-timezone branch from 4bb6bd3 to c152f6d Compare June 2, 2026 07:49
@Onatcer
Copy link
Copy Markdown
Contributor

Onatcer commented Jun 2, 2026

Thanks for the contribution.

I think changing the fallback to the local time is good, but it should not override the value stored on the server. The TimezoneMismatchModal does not currently exist in the Desktop app because there are no API endpoints for user settings yet (WIP solidtime-io/solidtime#1078) so the button to change it wouldnt work.

@Onatcer Onatcer merged commit 6074c24 into solidtime-io:main Jun 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS app uses wrong timezone for local time display/input

4 participants