mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Private events are hidden
Events with the class:PRIVATE iCal property are not shown in the calendar module. They are not added to the array of calendar events in createEventList. This feature can be turned on and off in the config via the property hidePrivate: true/false.
This commit is contained in:
parent
b8167f89e5
commit
cfeef98261
@ -267,6 +267,12 @@ Module.register("calendar",{
|
|||||||
var calendar = this.calendarData[c];
|
var calendar = this.calendarData[c];
|
||||||
for (var e in calendar) {
|
for (var e in calendar) {
|
||||||
var event = calendar[e];
|
var event = calendar[e];
|
||||||
|
if(this.config.hidePrivate) {
|
||||||
|
if(event.class === "PRIVATE") {
|
||||||
|
// do not add the current event, skip it
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
event.url = c;
|
event.url = c;
|
||||||
event.today = event.startDate >= today && event.startDate < (today + 24 * 60 * 60 * 1000);
|
event.today = event.startDate >= today && event.startDate < (today + 24 * 60 * 60 * 1000);
|
||||||
events.push(event);
|
events.push(event);
|
||||||
|
@ -108,6 +108,7 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries, maximumNumbe
|
|||||||
startDate: startDate.format("x"),
|
startDate: startDate.format("x"),
|
||||||
endDate: endDate.format("x"),
|
endDate: endDate.format("x"),
|
||||||
fullDayEvent: isFullDayEvent(event),
|
fullDayEvent: isFullDayEvent(event),
|
||||||
|
class: event.class,
|
||||||
firstYear: event.start.getFullYear()
|
firstYear: event.start.getFullYear()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -137,7 +138,8 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries, maximumNumbe
|
|||||||
title: title,
|
title: title,
|
||||||
startDate: startDate.format("x"),
|
startDate: startDate.format("x"),
|
||||||
endDate: endDate.format("x"),
|
endDate: endDate.format("x"),
|
||||||
fullDayEvent: fullDayEvent
|
fullDayEvent: fullDayEvent,
|
||||||
|
class: event.class
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user