diff --git a/CHANGELOG.md b/CHANGELOG.md index fb41a8de..d2c6244a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Added option `roundTemp` for currentweather and weatherforecast modules to display temperatures rounded to nearest integer. - Added abilty set the classes option to compliments module for style and text size of compliments. - Added ability to configure electronOptions +- Calendar module: option to hide private events ### Updated - Modified translations for Frysk. diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md index 31eb1e2f..de57f3b1 100644 --- a/modules/default/calendar/README.md +++ b/modules/default/calendar/README.md @@ -161,6 +161,13 @@ The following properties can be configured:
Default value: true + + hidePrivate + Hides private calendar events.
+
Possible values: true or false +
Default value: false + + diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 6282d130..3b6639df 100644 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -26,6 +26,7 @@ Module.register("calendar", { dateFormat: "MMM Do", getRelative: 6, fadePoint: 0.25, // Start on 1/4th of the list. + hidePrivate: false, calendars: [ { symbol: "calendar", @@ -270,6 +271,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); diff --git a/modules/default/calendar/calendarfetcher.js b/modules/default/calendar/calendarfetcher.js index cb989edf..e24ee004 100644 --- a/modules/default/calendar/calendarfetcher.js +++ b/modules/default/calendar/calendarfetcher.js @@ -114,6 +114,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(), location: location, geo: geo, @@ -148,6 +149,7 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries, maximumNumbe startDate: startDate.format("x"), endDate: endDate.format("x"), fullDayEvent: fullDayEvent, + class: event.class, location: location, geo: geo, description: description