Skip to content

fix(timezone): default to UTC instead of browser timezone#509

Merged
drankou merged 1 commit into
mainfrom
default-timezone-utc
Jul 15, 2026
Merged

fix(timezone): default to UTC instead of browser timezone#509
drankou merged 1 commit into
mainfrom
default-timezone-utc

Conversation

@drankou

@drankou drankou commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

When a user has no saved timezone preference, the dashboard now falls back to UTC instead of auto-detecting and persisting the browser's local timezone.

  • Removed the effect that detected and saved the browser timezone on first load.
  • The provider fallback stays DEFAULT_TIMEZONE (UTC), both server- and client-side.
  • Users can still opt into their browser timezone via the "Use browser timezone" button in Account → Timezone settings.

🤖 Generated with Claude Code

Previously the provider auto-detected and persisted the browser
timezone when no preference was saved. Now the fallback stays UTC;
users can still opt into their browser timezone from settings.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web-foxtrot Ready Ready Preview, Comment Jul 14, 2026 2:32pm

Request Review

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM — straightforward removal of the auto-detect-and-persist effect, falling back to UTC as intended.

What was reviewed: the removed effect's only side effects (setTimezoneState/persistTimezone) are cleanly deleted with no dangling references; confirmed getBrowserTimezone remains used elsewhere (time-range-picker, account timezone settings' "Use browser timezone" button) so removing the import here doesn't break those; the provider still falls back to DEFAULT_TIMEZONE (UTC) for both initial state and SSR.

Extended reasoning...

Overview

Single-file change in src/features/dashboard/timezone/context.tsx that removes a useEffect which previously auto-detected the browser's timezone on first load and persisted it via a POST to /api/timezone/state. The provider now simply keeps the UTC default when no saved preference exists, matching the PR title/description.

Security risks

None. This only changes client-side default behavior for displaying timestamps; no auth, permissions, or data exposure surface is touched.

Level of scrutiny

Low. The diff is a pure deletion of an effect (net -9 lines), no new logic introduced, no new API surface, and the removed code path's only consumer (persist + local state) is fully deleted together — no orphaned references.

Other factors

Verified getBrowserTimezone is still imported and used by timezone-settings.tsx (the opt-in "Use browser timezone" button) and by time-range-picker.logic.ts, so the PR doesn't silently break those flows. No outstanding review comments in the timeline; only a Vercel bot preview-deployment comment.

@drankou
drankou merged commit bc454c2 into main Jul 15, 2026
14 checks passed
@drankou
drankou deleted the default-timezone-utc branch July 15, 2026 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants