From 9686a9ba775aab94b53fdf91242d16426acb0686 Mon Sep 17 00:00:00 2001 From: Sam Detweiler Date: Mon, 18 Feb 2019 07:18:07 -0600 Subject: [PATCH] fix relative date fulldate events to use start of dat to start of day difference --- CHANGELOG.md | 1 + modules/default/calendar/calendar.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d97166d..5e591e59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Installation script problems with raspbian - Calendar: only show repeating count if the event is actually repeating [#1534](https://github.com/MichMich/MagicMirror/pull/1534) - Calendar: Fix exdate handling when multiple values are specified (comma separated) +- Calendar: Fix relative date handling for fulldate events, calculate difference always from start of day [#1572] (https://github.com/MichMich/MagicMirror/issues/1572) - Fix null dereference in moduleNeedsUpdate when the module isn't visible ### New weather module diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 2c2970ec..96ab322c 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -302,7 +302,7 @@ Module.register("calendar", { timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").format(this.config.fullDayEventDateFormat)); } } else { - timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow()); + timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").from(moment().format("YYYYMMDD"))); } } if(this.config.showEnd){