refactor(calendar): improve recurring event handling clarity and robustness#3900
Closed
KristjanESPERANTO wants to merge 5 commits intoMagicMirrorOrg:developfrom
Closed
refactor(calendar): improve recurring event handling clarity and robustness#3900KristjanESPERANTO wants to merge 5 commits intoMagicMirrorOrg:developfrom
KristjanESPERANTO wants to merge 5 commits intoMagicMirrorOrg:developfrom
Conversation
…stness
- enhance comments for better understanding of timezone conversions and recurrence logic
- replace `arrow functions` with `named functions` for improved readability
- compact `dtstart` normalization code to reduce duplication
- add conditional `tzid` reset to prevent errors on missing options
- snap all-day recurrences to event timezone midnight using `startOf("day")` to fix date drift
All-day recurring events were serialized as UTC timestamps sourced from the rrule result. Viewers west of UTC therefore saw the start date drift to the preceding day. Parse the rrule output as a floating YYYY-MM-DD first and only then apply viewer offsets so every client sees the same calendar date. Clean up temporary debugging scaffolding in the process.
- map recurring event instants with moment-timezone so viewer DST offsets stay correct - leave floating metadata available for full-day cases while returning structured payloads - update calendar fetcher unit spec to assert against the new occurrence wrapper
404f48b to
20bd913
Compare
sdetweil
reviewed
Sep 28, 2025
Collaborator
sdetweil
left a comment
There was a problem hiding this comment.
Remember to test with modules that receive our notifications
MMM-CalendarExt3xxxx
For sure
Collaborator
Author
|
@sdetweil Thanks 🙂 I'll keep it in mind and test whether this would break But I think I messed up a bit here - seems I wanted to fix things that doesn't need to be fixed 😅 I need to take deeper look at it. |
Collaborator
|
Yeh, it’s easy to say, I wouldn’t do it like this |
Collaborator
Author
|
Okay. I'll drop it for now. |
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.
arrow functionswithnamed functionsfor improved readabilitydtstartnormalization code to reduce duplicationtzidreset to prevent errors on missing optionsstartOf("day")to fix date driftThe trigger for all this is that I am currently trying
node-icalto get rid of the dependency on moment-timezone, and I wanted to better understand how we use it here.