Merge pull request #547 from dbahn25/hidePrivate

Hide private
This commit is contained in:
Michael Teeuw 2016-12-24 14:23:47 +01:00 committed by GitHub
commit 4237d0c7e3
4 changed files with 17 additions and 0 deletions

View File

@ -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.

View File

@ -161,6 +161,13 @@ The following properties can be configured:
<br><b>Default value:</b> <code>true</code>
</td>
</tr>
<tr>
<td><code>hidePrivate</code></td>
<td>Hides private calendar events.<br>
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
<br><b>Default value:</b> <code>false</code>
</td>
</tr>
</tbody>
</table>

View File

@ -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);

View File

@ -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