From c3b2aaec6935c2921b7ee8b1c8e51fccba1080b3 Mon Sep 17 00:00:00 2001 From: rejas Date: Tue, 10 May 2022 21:44:15 +0200 Subject: [PATCH 1/2] Show endDate for calendar events when dateHeader is enabled and showEnd is set to true --- modules/default/calendar/calendar.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 4a003daa..91e952d6 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -305,6 +305,12 @@ Module.register("calendar", { timeWrapper.className = "time light align-left " + this.timeClassForUrl(event.url); timeWrapper.style.paddingLeft = "2px"; timeWrapper.innerHTML = moment(event.startDate, "x").format("LT"); + + // Add endDate to dataheaders if showEnd is enabled + if (this.config.showEnd) { + timeWrapper.innerHTML += " - " + moment(event.endDate, "x").format("LT"); + } + eventWrapper.appendChild(timeWrapper); titleWrapper.classList.add("align-right"); } @@ -381,7 +387,7 @@ Module.register("calendar", { } } } else if (event.startDate - now < this.config.getRelative * oneHour) { - // If event is within getRelative hours, display 'in xxx' time format or moment.fromNow() + // If event is within getRelative hours, display 'in xxx' time format or moment.fromNow() timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow()); } } else { From ed3aceb42795117aaa32f61019bb23e013c2a883 Mon Sep 17 00:00:00 2001 From: rejas Date: Tue, 10 May 2022 21:44:23 +0200 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f7e61de..dc0b33c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ _This release is scheduled to be released on 2022-07-01._ ### Added +- Show endDate for calendar events when dateHeader is enabled and showEnd is set to true (#2192) by @doubled136 + ### Updated ### Fixed @@ -24,9 +26,9 @@ Special thanks to the following contributors: @10bias, @CFenner, @JHWelch, @k1rd ### Added - Added a config option under the weather module, `absoluteDates`, providing an option to format weather forecast date output with either absolute or relative dates. -- Added test for new weather forecast `absoluteDates` porperty. +- Added test for new weather forecast `absoluteDates` property. - The modules get a class hidden added/removed if they get hidden/shown which will also toggle pointer-events. -- Added new config option `showTitleAsUrl` to newsfeed module. If set, the diplayed title is a link to the article which is useful when running in a browser and you want to read this article. +- Added new config option `showTitleAsUrl` to newsfeed module. If set, the displayed title is a link to the article which is useful when running in a browser and you want to read this article. - Added internal cors proxy to get weather providers working without public proxies (fixes #2714). The new url `http(s)://address:port/cors?url=https://whatever-to-proxy` can be used in other modules too. - Added a WeatherProvider for Weatherflow. - Added new env var `ELECTRON_DISABLE_GPU` which disable gpu under electron if set (fixes #2831).