improvement(schedule): default schedule timezone#2800
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
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
|
| { label: 'Auckland (UTC+12)', id: 'Pacific/Auckland' }, | ||
| ], | ||
| value: () => 'UTC', | ||
| value: () => Intl.DateTimeFormat().resolvedOptions().timeZone, |
Contributor
There was a problem hiding this 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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Defaults schedule block timezone to user's default timezone
Type of Change
Testing
Manual
Checklist