Fix repeat event rendering once more

This commit is contained in:
Leo Vasanko 2025-08-23 11:34:04 -06:00
parent e1a240a1b0
commit 916d1d100a

View File

@ -167,8 +167,18 @@ function createWeek(virtualWeek) {
// Build day events starting with stored (base/spanning) then virtual occurrences // Build day events starting with stored (base/spanning) then virtual occurrences
const dayEvents = [...storedEvents] const dayEvents = [...storedEvents]
for (const base of repeatingBases) { for (const base of repeatingBases) {
// Skip if base spans this date // If the current date falls within the base event's original span, include the base
if (dateStr >= base.startDate && dateStr <= base.endDate) continue // event itself as occurrence index 0. Previously this was skipped which caused the
// first (n=0) occurrence of repeating events to be missing from the calendar.
if (dateStr >= base.startDate && dateStr <= base.endDate) {
dayEvents.push({
...base,
// Mark explicit recurrence index for consistency with virtual occurrences
_recurrenceIndex: 0,
_baseId: base.id,
})
continue
}
// Check if any virtual occurrence spans this date // Check if any virtual occurrence spans this date
const baseStart = fromLocalString(base.startDate) const baseStart = fromLocalString(base.startDate)