Skip to content

feat: timezone management#364

Open
sarimrmalik wants to merge 41 commits into
mainfrom
feat/timezone-preferences
Open

feat: timezone management#364
sarimrmalik wants to merge 41 commits into
mainfrom
feat/timezone-preferences

Conversation

@sarimrmalik

@sarimrmalik sarimrmalik commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Implements dashboard timezone preferences and applies the selected timezone consistently across timestamp display, monitoring, usage, and time-range selection. Linear

  • adds a dashboard timezone preference with settings UI, persisted state, and layout-level hydration/provider wiring
  • applies the selected timezone across dashboard timestamps, including sandboxes, builds, billing, members, templates, webhooks, and other table/detail surfaces
  • updates monitoring and usage flows so chart overlays, axis labels, presets, and time-range controls all use the dashboard timezone
  • centralizes date/time formatting behind shared timezone utilities (formatDate, formatDateParts, formatDateRange, getRelativeDay) and removes duplicated one-off formatters
  • aligns picker parsing/validation and min/max calendar bounds with dashboard timezone behavior instead of browser-local day boundaries
  • adds focused unit coverage for timezone formatting, picker logic, usage sampling/presets, and related utilities

- Added a new API endpoint for setting the user's timezone.
- Introduced TimezoneProvider and useTimezone hook for managing timezone state.
- Created TimezoneSettings component for users to select their preferred timezone.
- Updated dashboard layout to include timezone context and settings.
- Enhanced cookie management to store the user's timezone preference.

This feature allows users to customize how time-related data is displayed in the dashboard.
@cla-bot cla-bot Bot added the cla-signed label Jun 8, 2026
@vercel

vercel Bot commented Jun 8, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
web Ready Ready Preview, Comment Jun 15, 2026 3:37pm
web-juliett Error Error Jun 15, 2026 3:37pm

Request Review

@sarimrmalik sarimrmalik changed the title feat(timezone): implement timezone management in dashboard feat: implement timezone management in dashboard Jun 9, 2026
- Updated `useDateTimeState` to accept a timezone parameter for accurate date-time formatting.
- Integrated timezone management into the TimePicker and TimePanel components.
- Refactored date-time parsing and validation to utilize timezone-aware functions.
- Improved user experience by ensuring all date-time inputs respect the selected timezone.
- Added functions to format dates and times based on the user's timezone.
- Updated `formatAxisDate` and `formatHoveredValues` to accept a timezone parameter for accurate display.
- Implemented new utility functions for handling zoned date formatting.
- Created unit tests to verify timezone formatting functionality.
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
sarimrmalik and others added 3 commits June 11, 2026 16:33
… apply API

Co-authored-by: Cursor <cursoragent@cursor.com>
…tetime joins

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5166b0d3c7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

) {
'use no memo'

const { timezone } = useTimezone()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Align calendar limits with the selected timezone

When the selected dashboard timezone is not the browser timezone, this picker now parses and validates submissions in timezone, but the date-picker bounds below are still computed from browser-local new Date()/setHours. For users near a day boundary (for example browser in America/Los_Angeles with dashboard timezone Pacific/Auckland), the calendar can disable the selected-zone “today” even though validation and submission accept it, making valid custom monitoring ranges impossible to choose from the calendar. Compute these min/max calendar dates from the selected timezone as the shared TimeRangePicker does.

Useful? React with 👍 / 👎.

@drankou

drankou commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

nit: lets avoid layout shift when default button appears by setting constant height?
CleanShot 2026-06-15 at 16 59 22@2x
CleanShot 2026-06-15 at 16 59 19@2x

@drankou

drankou commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

improve search picker UX:

  1. Currently popover jumps if result can fit at the bottom -> let's keep popover always on top and move search input to bottom of the popover so it's stable across height changes
CleanShot 2026-06-15 at 17 06 57
  1. There is a brief state flicker between select and popover close, doesn't feel right
CleanShot.2026-06-15.at.17.20.04.mp4

- Removed direct imports of `formatDate`, `formatDateParts`, and `useTimezone` from the timezone module.
- Updated imports to utilize the new formatting utilities from `@/lib/utils/formatting`.
- Cleaned up the timezone settings and related components for better modularity and maintainability.
- Introduced a conditional button that allows users to select their browser's timezone if it differs from the currently selected timezone.
- Enhanced accessibility by managing button visibility and interaction based on the browser timezone availability.
@sarimrmalik sarimrmalik changed the title feat: implement timezone management in dashboard feat: timezone management Jun 16, 2026
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