-
Notifications
You must be signed in to change notification settings - Fork 3.2k
improvement(schedule): default schedule timezone #2800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryChanged schedule block timezone default from hardcoded Key changes:
Minor consideration:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Browser
participant ScheduleBlock
participant IntlAPI as Intl.DateTimeFormat
participant Backend
participant Croner
User->>Browser: Create new schedule
Browser->>ScheduleBlock: Initialize schedule block
ScheduleBlock->>IntlAPI: Intl.DateTimeFormat().resolvedOptions()
IntlAPI-->>ScheduleBlock: {timeZone: "America/New_York"}
ScheduleBlock->>ScheduleBlock: Set timezone default value
ScheduleBlock-->>Browser: Render with user's timezone
User->>Browser: Configure schedule & save
Browser->>Backend: POST workflow with timezone
Backend->>Backend: validateScheduleBlock()
Backend->>Backend: getScheduleTimeValues() (defaults to UTC if empty)
Backend->>Croner: Create cron with timezone
Croner-->>Backend: Validated schedule
Backend-->>Browser: Success
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, 1 comment
| { label: 'Auckland (UTC+12)', id: 'Pacific/Auckland' }, | ||
| ], | ||
| value: () => 'UTC', | ||
| value: () => Intl.DateTimeFormat().resolvedOptions().timeZone, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: User's browser timezone may not be in dropdown options. If Intl.DateTimeFormat().resolvedOptions().timeZone returns a timezone not in the predefined list (lines 132-174), the dropdown won't show it as selected. Consider adding fallback logic to match to closest option or ensure dropdown displays values not in options list.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/blocks/blocks/schedule.ts
Line: 175:175
Comment:
**style:** User's browser timezone may not be in dropdown options. If `Intl.DateTimeFormat().resolvedOptions().timeZone` returns a timezone not in the predefined list (lines 132-174), the dropdown won't show it as selected. Consider adding fallback logic to match to closest option or ensure dropdown displays values not in options list.
How can I resolve this? If you propose a fix, please make it concise.
Summary
Defaults schedule block timezone to user's default timezone
Type of Change
Testing
Manual
Checklist