From 7ba88a83f047046c038322e3ea25c227a2b2e3a9 Mon Sep 17 00:00:00 2001 From: vlb Date: Tue, 28 Aug 2018 13:05:06 +0200 Subject: [PATCH 1/4] consider events lasting several full days as full day events --- modules/default/calendar/calendarfetcher.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/default/calendar/calendarfetcher.js b/modules/default/calendar/calendarfetcher.js index ccd1f6c8aa..e3b53b0bb1 100644 --- a/modules/default/calendar/calendarfetcher.js +++ b/modules/default/calendar/calendarfetcher.js @@ -273,8 +273,7 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri var start = event.start || 0; var startDate = new Date(start); var end = event.end || 0; - - if (end - start === 24 * 60 * 60 * 1000 && startDate.getHours() === 0 && startDate.getMinutes() === 0) { + if (end - start >= 24 * 60 * 60 * 1000 && startDate.getHours() === 0 && startDate.getMinutes() === 0) { // Is 24 hours, and starts on the middle of the night. return true; } From c755c823facd697def2f7f2643b055108fe105be Mon Sep 17 00:00:00 2001 From: vlb Date: Tue, 28 Aug 2018 17:29:42 +0200 Subject: [PATCH 2/4] added support for events having a duration instead of an end --- CHANGELOG.md | 4 ++++ modules/default/calendar/calendarfetcher.js | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c242e502f..c8cac15b6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ This project adheres to [Semantic Versioning](http://semver.org/). --- +## Current - 2018-08-28 + +- Added support for events having a duration instead of an end. + ## [2.4.1] - 2018-07-04 ### Fixed diff --git a/modules/default/calendar/calendarfetcher.js b/modules/default/calendar/calendarfetcher.js index e3b53b0bb1..e8db5a95cd 100644 --- a/modules/default/calendar/calendarfetcher.js +++ b/modules/default/calendar/calendarfetcher.js @@ -90,6 +90,9 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri var endDate; if (typeof event.end !== "undefined") { endDate = eventDate(event, "end"); + } else if(typeof event.duration !== "undefined") { + dur=moment.duration(event.duration); + endDate = startDate.clone().add(dur); } else { if (!isFacebookBirthday) { endDate = startDate; @@ -273,7 +276,7 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri var start = event.start || 0; var startDate = new Date(start); var end = event.end || 0; - if (end - start >= 24 * 60 * 60 * 1000 && startDate.getHours() === 0 && startDate.getMinutes() === 0) { + if (((end - start) % (24 * 60 * 60 * 1000)) === 0 && startDate.getHours() === 0 && startDate.getMinutes() === 0) { // Is 24 hours, and starts on the middle of the night. return true; } From 7c579cf7b7af6b9f87a38b05ee78b432d0de5091 Mon Sep 17 00:00:00 2001 From: vlb Date: Tue, 28 Aug 2018 17:35:53 +0200 Subject: [PATCH 3/4] added support for showing end of events through config parameters showEnd and dateEndFormat --- modules/default/calendar/calendar.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 0780fb5c9c..d566e6c51a 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -25,7 +25,9 @@ Module.register("calendar", { urgency: 7, timeFormat: "relative", dateFormat: "MMM Do", + dateEndFormat: "HH:mm", fullDayEventDateFormat: "MMM Do", + showEnd: true, getRelative: 6, fadePoint: 0.25, // Start on 1/4th of the list. hidePrivate: false, @@ -287,6 +289,10 @@ Module.register("calendar", { timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow()); } } + if(this.config.showEnd){ + timeWrapper.innerHTML += "-" ; + timeWrapper.innerHTML += this.capFirst(moment(event.endDate , "x").format(this.config.fullDayEventDateFormat)); + } } else { if (event.startDate >= new Date()) { if (event.startDate - now < 2 * oneDay) { @@ -325,6 +331,11 @@ Module.register("calendar", { }) ); } + if (this.config.showEnd) { + timeWrapper.innerHTML += "-"; + timeWrapper.innerHTML += this.capFirst(moment(event.endDate, "x").format(this.config.dateEndFormat)); + + } } //timeWrapper.innerHTML += ' - '+ moment(event.startDate,'x').format('lll'); //console.log(event); From 5c25dd5b6df3bfca7317dac9d21f06d32dda00d5 Mon Sep 17 00:00:00 2001 From: Vincent Le Bourlot Date: Tue, 28 Aug 2018 18:00:13 +0200 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8cac15b6d..bcc063b74e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,9 +5,35 @@ This project adheres to [Semantic Versioning](http://semver.org/). --- -## Current - 2018-08-28 +## [2.5.0] - Unreleased -- Added support for events having a duration instead of an end. +*This release is scheduled to be released on 2018-10-01.* + +### Added +- French translate for "Feels" +- Translations for newsfeed module +- Support for toggling news article in fullscreen +- Hungarian translation for "Feels" and "Week" +- Spanish translation for "Feels" +- Add classes instead of inline style to the message from the module Alert +- Support for events having a duration instead of an end +- Support for showing end of events through config parameters showEnd and dateEndFormat + +### Fixed +- Mixup between german and spanish translation for newsfeed. +- Fixed close dates to be absolute, if no configured in the config.js - module Calendar +- Fix for weatherforecast rainfall rounding [#1374](https://github.com/MichMich/MagicMirror/issues/1374) +- Fix calendar parsing issue for Midori on RasperryPi Zero w, related to issue #694. +- Fix weather city ID link in sample config +- Fixed issue with clientonly not updating with IP address and port provided on command line. + +### Updated + +- Swedish translations +- Hungarian translations for the updatenotification module +- Updated Norsk bokmål translation +- Updated Norsk nynorsk translation +- Consider multi days event as full day events ## [2.4.1] - 2018-07-04