fix(frontend): parse cron scheduled session times as UTC#1496
fix(frontend): parse cron scheduled session times as UTC#1496machadovilaca wants to merge 6 commits intoambient-code:mainfrom
Conversation
cron-parser defaults to the local timezone, causing the "Next 3 runs" preview to show incorrect UTC times for users outside UTC. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
✅ Deploy Preview for cheerful-kitten-f556a0 canceled.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe cron parser in ChangesCron Timezone Configuration
🚥 Pre-merge checks | ✅ 8✅ Passed checks (8 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/cc @jsell-rh |
|
@machadovilaca Nice catch, thank you! Do you think it would be better to consistently show times in the browser's timezone? Including making the cron expression entry assume browser's TZ. Especially for the folks that aren't +/- 1 UTC, the offset calculation can be a point of friction. It would require a bit of transformation to take the hour from the cron entry on the frontend so that the user inputs in their local TZ and the API call uses UTC, but it might be a nice quality of life improvement. What do you think? |
@jsell-rh i think that makes sense basically would become should this be done as part of this PR, or in a follow-up? |
cron-parser defaults to the browser's local timezone, so "Next 3 runs" shows times offset from UTC even though the cron expression is stored and executed as UTC
shows 7:30 AM UTC (8:30 AM GMT+1) for next run
shows a different time: At 08:30 AM UTC
Fixed by passing { tz: "UTC" } to CronExpressionParser.parse() so next run calculations match UTC
Summary by CodeRabbit