Skip to content

Commit c82de1e

Browse files
committed
Group filters that only apply when limiting for display
1 parent 604a555 commit c82de1e

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

modules/default/calendar/calendar.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -496,22 +496,20 @@ Module.register("calendar", {
496496
for (const e in calendar) {
497497
const event = JSON.parse(JSON.stringify(calendar[e])); // clone object
498498

499-
if (event.endDate < now && limitNumberOfEntries) {
499+
if (this.config.hidePrivate && event.class === "PRIVATE") {
500+
// do not add the current event, skip it
500501
continue;
501502
}
502-
if (this.config.hidePrivate) {
503-
if (event.class === "PRIVATE") {
504-
// do not add the current event, skip it
503+
if (limitNumberOfEntries) {
504+
if (event.endDate < now) {
505505
continue;
506506
}
507-
}
508-
if (this.config.hideOngoing && limitNumberOfEntries) {
509-
if (event.startDate < now) {
507+
if (this.config.hideOngoing && event.startDate < now) {
508+
continue;
509+
}
510+
if (this.listContainsEvent(events, event)) {
510511
continue;
511512
}
512-
}
513-
if (this.listContainsEvent(events, event) && limitNumberOfEntries) {
514-
continue;
515513
}
516514
event.url = calendarUrl;
517515
event.today = event.startDate >= today && event.startDate < today + 24 * 60 * 60 * 1000;

0 commit comments

Comments
 (0)