Return full list of events from createEventList for broadcasting

This commit is contained in:
Jonathan Kolb
2022-01-13 11:01:06 -05:00
committed by Jon Kolb
parent fcb0d33e29
commit 0aee42255f
3 changed files with 17 additions and 35 deletions

View File

@@ -498,23 +498,7 @@ const CalendarUtils = {
return a.startDate - b.startDate;
});
// include up to maximumEntries current or upcoming events
// If past events should be included, include all past events
const now = moment();
let entries = 0;
let events = [];
for (let ne of newEvents) {
if (moment(ne.endDate, "x").isBefore(now)) {
if (config.includePastEvents) events.push(ne);
continue;
}
entries++;
// If max events has been saved, skip the rest
if (entries > config.maximumEntries) break;
events.push(ne);
}
return events;
return newEvents;
},
/**