From a17ac1c16e6bec608bcc9dc5b9bf47bb1707ea43 Mon Sep 17 00:00:00 2001 From: Josef Spitzlberger <38983450+spitzlbergerj@users.noreply.github.com> Date: Sat, 13 Apr 2019 15:03:55 +0200 Subject: [PATCH 1/6] added Config Option nextDaysRelative added configuration option nextDaysRelative to always display today's and tomorrow's appointments in relative mode, even if timeformat is set to absolute --- modules/default/calendar/calendar.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 3aaed2ae..7133caaa 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -49,7 +49,8 @@ Module.register("calendar", { }, broadcastEvents: true, excludedEvents: [], - sliceMultiDayEvents: false + sliceMultiDayEvents: false, + nextDaysRelative: false }, // Define required scripts. @@ -326,7 +327,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' From d24e10a72853aeabf12af3c64c8af783b8a53c5b Mon Sep 17 00:00:00 2001 From: Josef Spitzlberger <38983450+spitzlbergerj@users.noreply.github.com> Date: Sat, 13 Apr 2019 15:06:47 +0200 Subject: [PATCH 2/6] added config option nextDaysRelative added configuration option nextDaysRelative to always display today's and tomorrow's appointments in relative mode, even if timeformat is set to absolute --- modules/default/calendar/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md index 65362a81..33d09274 100755 --- a/modules/default/calendar/README.md +++ b/modules/default/calendar/README.md @@ -54,8 +54,8 @@ 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` - +| `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 From 03f917fd9c026dc2fc3bf74aec8d2f08a415daa6 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Tue, 7 May 2019 20:31:41 +0200 Subject: [PATCH 3/6] Update changelog. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 134dc4c5..3391b9fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +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 ### Updated - English translation for "Feels" to "Feels like" From 7e2ab51298f0e8476c95f515c594db09271d9d19 Mon Sep 17 00:00:00 2001 From: Josef Spitzlberger <38983450+spitzlbergerj@users.noreply.github.com> Date: Sat, 13 Apr 2019 15:03:55 +0200 Subject: [PATCH 4/6] added Config Option nextDaysRelative added configuration option nextDaysRelative to always display today's and tomorrow's appointments in relative mode, even if timeformat is set to absolute --- modules/default/calendar/calendar.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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' From 41e5c2939f74a1dc6132c587f6e6977a6f70b891 Mon Sep 17 00:00:00 2001 From: Josef Spitzlberger <38983450+spitzlbergerj@users.noreply.github.com> Date: Sat, 13 Apr 2019 15:06:47 +0200 Subject: [PATCH 5/6] added config option nextDaysRelative added configuration option nextDaysRelative to always display today's and tomorrow's appointments in relative mode, even if timeformat is set to absolute --- modules/default/calendar/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From 17c581b4aa52bdf9f2f12a984f91a2620aa62908 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Tue, 7 May 2019 20:31:41 +0200 Subject: [PATCH 6/6] Update changelog. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a1b9b4b..a5dff53a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +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