Skip to content

Fix: Show the current UTC offset in the timezone setting - #773

Merged
axllent merged 1 commit into
axllent:developfrom
dalexhu:fix/timezone-offset-labels
Nov 13, 2026
Merged

axllent merged 1 commit into
axllent:developfrom
dalexhu:fix/timezone-offset-labels

Conversation

@dalexhu

@dalexhu dalexhu commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

The timezone select in Settings → Web UI uses the labels from timezones-list, which have one fixed offset per zone. That label is wrong for half the year in every zone with daylight saving (e.g. America/Toronto is always shown as GMT-05:00, also in summer), and it goes stale when a region changes its rules: America/Edmonton is listed as GMT-07:00, but Alberta has stayed on UTC-6 year-round since November 2026 (tzdata 2026f).

The selected value was already right (it is the IANA name, and the default comes from the browser); only the text was misleading.

Change

  • New server/ui-src/utils/timezones.js: builds each label from the browser's own timezone data for the current date (Intl.DateTimeFormat with timeZoneName: "longOffset"), e.g. America/Edmonton (GMT-06:00). If the browser does not know a zone, the original timezones-list label is kept.
  • AppSettings.vue uses these labels; the option values (tzCode) are unchanged.
  • Unit tests in timezones.test.js (DST on/off, UTC, half-hour offset, unknown zone, fallback).

Testing

  • npm test (46 passing), npm run lint, npm run package.
  • Built the Docker image and checked the settings dialog in Chrome: Edmonton shows GMT-06:00, Toronto GMT-05:00, Vancouver GMT-07:00, Kolkata GMT+05:30, London GMT+00:00.

The labels from timezones-list have a fixed offset per zone, so they are wrong while daylight saving is in effect and when a region changes its rules (America/Edmonton is listed as GMT-07:00 but has been UTC-6 year-round since November 2026). Build the offset from the browser's Intl data for the current date instead, keeping the static label as a fallback for zones the browser does not know.
@axllent
axllent merged commit 7bcfc89 into axllent:develop Nov 13, 2026
8 checks passed
@axllent

axllent commented Nov 13, 2026

Copy link
Copy Markdown
Owner

Thank you

@dalexhu
dalexhu deleted the fix/timezone-offset-labels branch November 15, 2026 04:51
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.

2 participants