diff --git a/defaultmodules/calendar/calendar.js b/defaultmodules/calendar/calendar.js index e70cbb852d..a42c54f388 100644 --- a/defaultmodules/calendar/calendar.js +++ b/defaultmodules/calendar/calendar.js @@ -588,9 +588,9 @@ Module.register("calendar", { if (eventsByDate[dateStr] && eventsByDate[dateStr].length > 0) { // If there are any events today then get all those events and select the currently active events and the events that are starting later in the day. newEvents.push(...eventsByDate[dateStr].filter((ev) => this.timestampToMoment(ev.endDate).isAfter(moment()))); - // Since we found a day with events, increase the daysCollected by 1 - daysCollected++; } + // Increment the daysCollected by one to ensure the while loop does not get stuck. + daysCollected++; // Search for the next day currentDate.add(1, "day"); }