Fix calendar rrule until where event is fullday but rrule until has a non-0 time (#3782)

This fixes #3781 

tests supplied

see
https://forum.magicmirror.builders/topic/19637/issue-with-outlook-recurring-events
This commit is contained in:
sam detweiler
2025-05-12 16:39:36 -05:00
committed by GitHub
parent ed419ce5b3
commit 2422e847b1
5 changed files with 70 additions and 0 deletions

View File

@@ -293,6 +293,13 @@ const CalendarFetcherUtils = {
event.start = rule.options.dtstart;
// if until is set, and its a full day event, force the time to midnight. rrule gets confused with non-00 offset
// looks like MS Outlook sets the until time incorrectly for fullday events
if ((rule.options.until !== undefined) && CalendarFetcherUtils.isFullDayEvent(event)) {
Log.debug("fixup rrule until");
rule.options.until = new Date(new Date(moment(rule.options.until).startOf("day").add(1, "day")).getTime());
}
Log.debug("fix rrule start=", rule.options.dtstart);
Log.debug("event before rrule.between=", JSON.stringify(event, null, 2), "exdates=", event.exdate);
// fixup the exdate and recurrence date to local time too for post between() handling