fix(caldav): expand recurring events in range

The iCal parser returned master VEVENT components with their
original start dates instead of expanding recurrences. Events
from months ago appeared in today's feed.

parseICalEvents now accepts an optional timeRange. When set,
recurring events are expanded via ical.js iterator and only
occurrences overlapping the range are returned. Exception
overrides (RECURRENCE-ID) are applied during expansion.

Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
2026-03-03 01:30:49 +00:00
parent caf48484bf
commit d7d8dba2de
9 changed files with 340 additions and 14 deletions

View File

@@ -184,7 +184,7 @@ export class CalDavSource implements FeedSource<CalDavFeedItem> {
for (const obj of objects) {
if (typeof obj.data !== "string") continue
const events = parseICalEvents(obj.data, calendarName)
const events = parseICalEvents(obj.data, calendarName, { start, end })
for (const event of events) {
allEvents.push(event)
}