diff --git a/CHANGELOG.md b/CHANGELOG.md index 81665ebb..1b44bb77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Added - Enabled translation of feelsLike for module currentweather +- Added support for on-going calendar events ### Changed - Use Electron 2 Beta. **Please test!** diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md index 2481b77b..8605dc3a 100644 --- a/modules/default/calendar/README.md +++ b/modules/default/calendar/README.md @@ -46,6 +46,7 @@ The following properties can be configured: | `urgency` | When using a timeFormat of `absolute`, the `urgency` setting allows you to display events within a specific time frame as `relative`. This allows events within a certain time frame to be displayed as relative (in xx days) while others are displayed as absolute dates

**Possible values:** a positive integer representing the number of days for which you want a relative date, for example `7` (for 7 days)

**Default value:** `7` | `broadcastEvents` | If this property is set to true, the calendar will broadcast all the events to all other modules with the notification message: `CALENDAR_EVENTS`. The event objects are stored in an array and contain the following fields: `title`, `startDate`, `endDate`, `fullDayEvent`, `location` and `geo`.

**Possible values:** `true`, `false`

**Default value:** `true` | `hidePrivate` | Hides private calendar events.

**Possible values:** `true` or `false`
**Default value:** `false` +| `hideOngoing` | Hides calendar events that have already started.

**Possible values:** `true` or `false`
**Default value:** `false` | `excludedEvents` | An array of words / phrases from event titles that will be excluded from being shown.

Additionally advanced filter objects can be passed in. Below is the configuration for the advance filtering object.
**Required**
`filterBy` - string used to determine if filter is applied.
**Optional**
`until` - Time before an event to display it Ex: [`'3 days'`, `'2 months'`, `'1 week'`]
`caseSensitive` - By default, excludedEvents are case insensitive, set this to true to enforce case sensitivity

**Example:** `['Birthday', 'Hide This Event', {filterBy: 'Payment', until: '6 days', caseSensitive: true}]`
**Default value:** `[]` ### Calendar configuration diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index cce9b31e..32b65b37 100644 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -29,6 +29,7 @@ Module.register("calendar", { getRelative: 6, fadePoint: 0.25, // Start on 1/4th of the list. hidePrivate: false, + hideOngoing: false, colored: false, calendars: [ { @@ -336,6 +337,7 @@ Module.register("calendar", { createEventList: function () { var events = []; var today = moment().startOf("day"); + var now = new Date(); for (var c in this.calendarData) { var calendar = this.calendarData[c]; for (var e in calendar) { @@ -346,6 +348,11 @@ Module.register("calendar", { continue; } } + if(this.config.hideOngoing) { + if(event.startDate < now) { + continue; + } + } event.url = c; event.today = event.startDate >= today && event.startDate < (today + 24 * 60 * 60 * 1000); events.push(event);