mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 12:12:20 +00:00
Group filters that only apply when limiting for display
This commit is contained in:
parent
604a555e14
commit
c82de1e314
@ -496,23 +496,21 @@ Module.register("calendar", {
|
|||||||
for (const e in calendar) {
|
for (const e in calendar) {
|
||||||
const event = JSON.parse(JSON.stringify(calendar[e])); // clone object
|
const event = JSON.parse(JSON.stringify(calendar[e])); // clone object
|
||||||
|
|
||||||
if (event.endDate < now && limitNumberOfEntries) {
|
if (this.config.hidePrivate && event.class === "PRIVATE") {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (this.config.hidePrivate) {
|
|
||||||
if (event.class === "PRIVATE") {
|
|
||||||
// do not add the current event, skip it
|
// do not add the current event, skip it
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
if (limitNumberOfEntries) {
|
||||||
if (this.config.hideOngoing && limitNumberOfEntries) {
|
if (event.endDate < now) {
|
||||||
if (event.startDate < now) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
if (this.config.hideOngoing && event.startDate < now) {
|
||||||
if (this.listContainsEvent(events, event) && limitNumberOfEntries) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (this.listContainsEvent(events, event)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
event.url = calendarUrl;
|
event.url = calendarUrl;
|
||||||
event.today = event.startDate >= today && event.startDate < today + 24 * 60 * 60 * 1000;
|
event.today = event.startDate >= today && event.startDate < today + 24 * 60 * 60 * 1000;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user