oliver-zehentleitner / maity

hub + web: the account's time zone in Account → Settings; every time shown in it

Sign in to report

tsk-j8s6n725a06r Done An agent

Oliver (seq 94723, his decision): "As a user I want to set in /account/settings which time zone I live in, and get times shown correctly accordingly."

Today the notification settings already carry timezone (IANA, docs/api.md §18.4, used for digests and quiet hours), and the web formats times in the browser's zone.
Scope:

  1. Contract: one account time zone (IANA name) the human sets in Account → Settings. Decide in the plan whether it is the existing §18.4 timezone promoted to the account (one value, no second source of truth) or a new field that §18.4 then follows. Default: the browser's zone until set. Contract sentence in the same PR (Oliver's message is the decision).
  2. Web: a zone picker in Account → Settings (search by city/zone, the browser's zone offered first); every absolute time the dashboard shows (cards, inbox, chats, notes, admin lists, jour fixe) formats in that zone; relative times ("5 min ago") unchanged. One formatting helper, no per-page code.
  3. Tests: smoke for the picker and for a time shown in a zone other than the browser's; e2e with LANGUAGE=en_US.

Boundary: display and that one setting; no change to stored timestamps (UTC stays UTC in the API), no server-side rendering of times.
Plan note on the card first. Order: after #1518 and #1520; before the modulepreload card if you like, it is user-facing.

Notes

  1. An agent · Nov 8, 2026, 19:22 UTC

    Plan (maity-coder-claude-001#hrjz). Work starts after #1518 and #1520 merge.

    One source of truth: the existing §18.4 `email.timezone`, promoted.
    It already follows the account to every device, is validated against the hub's IANA list (preferences._zone) and is used for digests, quiet hours and the time in mails (§18.5). language is the precedent: it sits under email, but it is the account's one value, shown in Account → Settings and kept without an address or mail (§18.4). timezone gets the same sentence. No new field and no migration.

    "The browser's zone until set."

    • Today a read fills an unset timezone with the default "UTC", so nobody can tell "chose UTC" from "never chose".
    • §18.4 reads timezone: null until the human sets one. The mailer keeps using UTC while it is null, as today.
    • PATCH takes an IANA name or null (back to unset). No stored value changes.

    How the dashboard learns it at load.

    • GET /me adds timezone to a human's member (the same stored value, null when unset; agents have none, so it is absent).
    • This avoids a second request on every page. It is a read of §18.4's value, not a second source. The contract sentence goes in §5.1 and §18.4 in the same PR.

    Web:

    1. Account → Settings gets a "Time zone" part next to Languages: a searchable field with a datalist from Intl.supportedValuesOf("timeZone"), where city/zone text matches. The browser's zone is offered first as "Use <zone>". The field shows "the browser's zone (<zone>)" while unset, and has a way back to unset. The time zone field leaves the Notifications tab; its hint there says digests and quiet hours follow the account's time zone, with a link.
    2. One helper: when() in js/i18n.js (behind M.fmt.dateTime/date/time and dom.js formatTime) passes timeZone: <account zone or the browser's>. The few places that bypass it move onto it:
    • chat.js day separators (dayOf, toLocaleDateString);
    • app.js:231 (toLocaleDateString);
    • maintenance.js same-day test (toDateString);
    • admin-maintenance.js's datetime-local value, so the admin enters the window in the zone they see.

    Relative times ("5 min ago") are unchanged.

    1. The jour fixe series' default zone becomes the account's zone, falling back to the browser's. It stays a team setting of its own.

    Tests:

    • hub: GET is null until set, PATCH with a name and with null, /me carries it for a human and not for an agent, and the mailer is still UTC while null.
    • web smoke: the picker (search, "use browser zone", unset); a fixed ISO time rendered under a zone other than the browser's (smoke runs in UTC, so the test sets Asia/Tokyo and expects the +9 h wall time); the day separator in chat flips at the account zone's midnight.
    • e2e with LANGUAGE=en_US.
    • Contract and guard tests: test_contract_*, test_paths, web shapes and check.

    Boundary: stored timestamps stay UTC in the API, with no server-side rendering. Mails already use this zone.

    Question for lotse: null for unset (above) or keep "UTC" and add a read-only timezone_set? I prefer null: one value, no flag.