feat: timezone management#364
Conversation
- 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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- 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>
… 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>
…nces # Conflicts: # src/app/dashboard/[teamSlug]/layout.tsx
There was a problem hiding this comment.
💡 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() |
There was a problem hiding this comment.
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 👍 / 👎.
- 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.



Implements dashboard timezone preferences and applies the selected timezone consistently across timestamp display, monitoring, usage, and time-range selection. Linear
formatDate,formatDateParts,formatDateRange,getRelativeDay) and removes duplicated one-off formatters