From ba63a44ec89f74ffe82f5a0c79d84ea88b58cdce Mon Sep 17 00:00:00 2001 From: retroflex Date: Fri, 28 Apr 2017 23:31:07 +0200 Subject: [PATCH 1/3] Added option to set a separate date format for full day events. --- modules/default/calendar/README.md | 1 + modules/default/calendar/calendar.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md index 003c13e1..8ce9608b 100644 --- a/modules/default/calendar/README.md +++ b/modules/default/calendar/README.md @@ -40,6 +40,7 @@ The following properties can be configured: | `titleReplace` | An object of textual replacements applied to the tile of the event. This allow to remove or replace certains words in the title.

**Example:** `{'Birthday of ' : '', 'foo':'bar'}`
**Default value:** `{ "De verjaardag van ": "", "'s birthday": "" }` | `displayRepeatingCountTitle` | Show count title for yearly repeating events (e.g. "X. Birthday", "X. Anniversary")

**Possible values:** `true` or `false`
**Default value:** `false` | `dateFormat` | Format to use for the date of events (when using absolute dates)

**Possible values:** See [Moment.js formats](http://momentjs.com/docs/#/parsing/string-format/)
**Default value:** `MMM Do` (e.g. Jan 18th) +| `fullDayEventDateFormat` | Format to use for the date of full day events (when using absolute dates)

**Possible values:** See [Moment.js formats](http://momentjs.com/docs/#/parsing/string-format/)
**Default value:** `MMM Do` (e.g. Jan 18th) | `timeFormat` | Display event times as absolute dates, or relative time

**Possible values:** `absolute` or `relative`
**Default value:** `relative` | `getRelative` | How much time (in hours) should be left until calendar events start getting relative?

**Possible values:** `0` (events stay absolute) - `48` (48 hours before the event starts)
**Default value:** `6` | `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` diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index fa77c94a..19555baf 100644 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -25,6 +25,7 @@ Module.register("calendar", { urgency: 7, timeFormat: "relative", dateFormat: "MMM Do", + fullDayEventDateFormat: "MMM Do", getRelative: 6, fadePoint: 0.25, // Start on 1/4th of the list. hidePrivate: false, @@ -228,7 +229,7 @@ Module.register("calendar", { // This event falls within the config.urgency period that the user has set timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow()); } else { - timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").format(this.config.dateFormat)); + timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").format(this.config.fullDayEventDateFormat)); } } else { timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow()); From af48af508534c0e7d2823f0802fb7c016e9cd5e6 Mon Sep 17 00:00:00 2001 From: retroflex Date: Fri, 28 Apr 2017 23:56:05 +0200 Subject: [PATCH 2/3] Updated changelog: Added option to set a separate date format for full day events. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e44d591c..8fde6318 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Add test default modules present modules/default/defaultmodules.js. - Add unit test calendar_modules function capFirst. - Add test for check if exits the directories present in defaults modules. +- Add calendar option to set a separate date format for full day events. ### Updated - Added missing keys to Polish translation. From 07c50c20b6cdc20692e11c3e454d455e29de379c Mon Sep 17 00:00:00 2001 From: retroflex Date: Tue, 2 May 2017 21:20:35 +0200 Subject: [PATCH 3/3] Spaces -> tabs. --- modules/default/calendar/calendar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 19555baf..0808ab08 100644 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -25,7 +25,7 @@ Module.register("calendar", { urgency: 7, timeFormat: "relative", dateFormat: "MMM Do", - fullDayEventDateFormat: "MMM Do", + fullDayEventDateFormat: "MMM Do", getRelative: 6, fadePoint: 0.25, // Start on 1/4th of the list. hidePrivate: false,