Fix Calendar Timezone Bug and Improve Date Processing#4
Fix Calendar Timezone Bug and Improve Date Processing#4john-costanzo wants to merge 3 commits intomasterfrom
Conversation
- Moved Eastern Time parsing and date creation to js/event-utils.js for global use. - Updated calendar URL generation to correctly interpret event times as Eastern Time, regardless of user timezone. - Fixed a bug where midnight events were incorrectly offset due to Intl.DateTimeFormat output discrepancy. - Refactored getLocalISODateString for more robust Eastern Time offset calculation. - Improved event filtering logic to be timezone-aware. - Cleaned up duplicated organizeEventsByDate function in js/event-utils.js. Co-authored-by: john-costanzo <20625467+john-costanzo@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Moved Eastern Time parsing and date creation to js/event-utils.js for global use. - Updated calendar URL generation to correctly interpret event times as Eastern Time, regardless of user timezone. - Fixed a bug where midnight events were incorrectly offset due to Intl.DateTimeFormat output discrepancy. - Refactored getLocalISODateString for more robust Eastern Time offset calculation. - Improved event filtering logic to be timezone-aware. - Cleaned up duplicated organizeEventsByDate function in js/event-utils.js. Co-authored-by: john-costanzo <20625467+john-costanzo@users.noreply.github.com>
Co-authored-by: john-costanzo <20625467+john-costanzo@users.noreply.github.com>
The application was incorrectly using the user's local browser timezone to interpret event times, which resulted in shifted times for users outside the Eastern Time zone.
I have implemented centralized timezone-aware date processing:
toUTCFormatandaddToCalendarnow force the interpretation of input date strings as Eastern Time using newcreateETDateandparseETutilities. This ensures Google Calendar and other providers receive the correct UTC times.Intl.DateTimeFormatwould return "24" for midnight in some environments, ensuring consistent DST offset selection.getLocalISODateStringnow reliably determines the Eastern Time offset using theshortOffsettime zone name, making "today" calculations consistent.organizeEventsByDate.Verified the fix with Playwright tests for both Standard Time and Daylight Saving Time events.
PR created automatically by Jules for task 17047890706082896605 started by @john-costanzo