Skip to content

Fix Calendar Timezone Bug and Improve Date Processing#4

Open
john-costanzo wants to merge 3 commits intomasterfrom
fix-calendar-timezone-bug-17047890706082896605
Open

Fix Calendar Timezone Bug and Improve Date Processing#4
john-costanzo wants to merge 3 commits intomasterfrom
fix-calendar-timezone-bug-17047890706082896605

Conversation

@john-costanzo
Copy link
Owner

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:

  1. Fixed Calendar Links: toUTCFormat and addToCalendar now force the interpretation of input date strings as Eastern Time using new createETDate and parseET utilities. This ensures Google Calendar and other providers receive the correct UTC times.
  2. Corrected Midnight Handling: Addressed an issue where Intl.DateTimeFormat would return "24" for midnight in some environments, ensuring consistent DST offset selection.
  3. Robust ISO Formatting: getLocalISODateString now reliably determines the Eastern Time offset using the shortOffset time zone name, making "today" calculations consistent.
  4. Timezone-Aware Filtering: Updated event filtering to compare event end times against UTC "now" correctly.
  5. Code Cleanup: Removed a duplicate definition of 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

- 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>
@google-labs-jules
Copy link
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules bot and others added 2 commits March 1, 2026 02:39
- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant