diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a1b9b4b..8571e72f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Option to show event location in calendar - Finnish translation for "Feels" and "Weeks" - Russian translation for “Feels” - +- Calendar module: added `nextDaysRelative` config option - Add `broadcastPastEvents` config option for calendars to include events from the past `maximumNumberOfDays` in event broadcasts ### Updated diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md index 786f7362..eb9324f2 100755 --- a/modules/default/calendar/README.md +++ b/modules/default/calendar/README.md @@ -54,9 +54,9 @@ The following properties can be configured: | `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
`regex` - set to `true` if filterBy is a regex. For those not familiar with regex it is used for pattern matching, please see [here](https://regexr.com/) for more info.

**Example:** `['Birthday', 'Hide This Event', {filterBy: 'Payment', until: '6 days', caseSensitive: true}, {filterBy: '^[0-9]{1,}.*', regex: true}]`
**Default value:** `[]` -| `sliceMultiDayEvents` | If this is set to true, events exceeding at least one midnight will be sliced into separate events including a counter like (1/2). This is especially helpful in "dateheaders" mode. Events will be sliced at midnight, end time for all events but the last will be 23:59 **Default value:** `false` | `broadcastPastEvents` | If this is set to true, events from the past `maximumNumberOfDays` will be included in event broadcasts
**Default value:** `false` - +| `sliceMultiDayEvents` | If this is set to true, events exceeding at least one midnight will be sliced into separate events including a counter like (1/2). This is especially helpful in "dateheaders" mode. Events will be sliced at midnight, end time for all events but the last will be 23:59
**Default value:** `true` +| `nextDaysRelative ` | If this is set to true, the appointments of today and tomorrow are displayed relatively, even if the timeformat is set to absolute.
**Default value:** `false` ### Calendar configuration diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 45009934..1b1fbc51 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -51,6 +51,7 @@ Module.register("calendar", { excludedEvents: [], sliceMultiDayEvents: false, broadcastPastEvents: false, + nextDaysRelative: false }, // Define required scripts. @@ -328,7 +329,7 @@ Module.register("calendar", { // If event is within 6 hour, display 'in xxx' time format or moment.fromNow() timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow()); } else { - if(this.config.timeFormat === "absolute") { + if(this.config.timeFormat === "absolute" && !this.config.nextDaysRelative) { timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").format(this.config.dateFormat)); } else { // Otherwise just say 'Today/Tomorrow at such-n-such time'