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:
Daniel Buecheler 2016-11-30 21:09:57 +01:00
parent b8167f89e5
commit cfeef98261
2 changed files with 9 additions and 1 deletions

View File

@ -267,6 +267,12 @@ Module.register("calendar",{
var calendar = this.calendarData[c];
for (var e in calendar) {
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.today = event.startDate >= today && event.startDate < (today + 24 * 60 * 60 * 1000);
events.push(event);

View File

@ -108,6 +108,7 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries, maximumNumbe
startDate: startDate.format("x"),
endDate: endDate.format("x"),
fullDayEvent: isFullDayEvent(event),
class: event.class,
firstYear: event.start.getFullYear()
});
}
@ -137,7 +138,8 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries, maximumNumbe
title: title,
startDate: startDate.format("x"),
endDate: endDate.format("x"),
fullDayEvent: fullDayEvent
fullDayEvent: fullDayEvent,
class: event.class
});
}