Fix event sorting by timezone-aware display time#62
Closed
CR0CKER wants to merge 4 commits intosawhney17:mainfrom
Closed
Fix event sorting by timezone-aware display time#62CR0CKER wants to merge 4 commits intosawhney17:mainfrom
CR0CKER wants to merge 4 commits intosawhney17:mainfrom
Conversation
- Fixed hardcoded date range (2021-2023) in recurring event generation Now dynamically generates events from 1 year ago to 2 years in future - Fixed timezone handling for recurring events with tzid - Added null check in parseLocation() to prevent "TypeError: b is not iterable" when event locations don't contain URLs - Added cache-busting headers to force fresh calendar data 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This is the confirmed working version of the plugin. Bug fixes included: - Fixed hardcoded date range (2021-2023) for recurring events Now dynamically generates from 1 year ago to 2 years in future - Fixed timezone handling for recurring events with tzid - Fixed parseLocation() null check preventing "TypeError: b is not iterable" - Removed CORS-triggering headers (Cache-Control, Pragma, Expires) - Added cache-busting URL parameter for fresh calendar data Build configuration: - Added .parcelrc configuration - Built with Node 16.20.2 using NVM - Updated package-lock.json with esbuild dev dependency Deployment: - Plugin works in Developer mode (file:// protocol) - Load as unpacked plugin from source directory - Tested and confirmed working on December 9, 2025 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…sion Recurring events with timezone information (tzid) were being displayed with incorrect times because the timezone was lost during JavaScript Date conversion. This caused events to be shown in the local system timezone instead of the event's original timezone. Changes: - Preserve timezone info in recurring event objects - Update formatTime() to accept optional timezone parameter and use moment-timezone for accurate time extraction - Calculate end times correctly for recurring events based on original duration - Pass timezone info through the formatting pipeline 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Filter out events with invalid dates to prevent NaN comparisons - Sort events by displayed time in their original timezone, not absolute timestamps - Fix timezone conversion for recurring events using moment.tz object notation - Correct insertion order to match chronological sort order This ensures events appear in the correct chronological order (e.g., 13:45, 14:30, 16:00) even when events are created in different timezones. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Author
|
Closing this PR as it has been superseded by #63, which includes this fix along with several other related improvements:
Please review #63 instead for a comprehensive set of calendar improvements. |
6 tasks
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
This PR fixes a bug where calendar events were not appearing in the correct chronological order when events from different timezones were present on the same day.
Changes
Example
Before this fix, events on the same day would appear incorrectly:
After this fix, they appear in correct chronological order:
Testing
Tested with multiple calendars containing events in different timezones (Central European Standard Time, Central European Summer Time, etc.) and confirmed events now sort correctly by their displayed time.
🤖 Generated with Claude Code