From 2163c5c31f1f7b2f64d2735f2b5ead2e6cff9a4f Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 13 Apr 2021 17:44:35 +0200 Subject: [PATCH] Fix allDay events notifications --- www/common/outer/calendar.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/www/common/outer/calendar.js b/www/common/outer/calendar.js index ed6da0531..9d399f310 100644 --- a/www/common/outer/calendar.js +++ b/www/common/outer/calendar.js @@ -90,8 +90,9 @@ define([ }); }; - var updateEventReminders = function (ctx, reminders, ev, useLastVisit) { + var updateEventReminders = function (ctx, reminders, _ev, useLastVisit) { var now = +new Date(); + var ev = Util.clone(_ev); var uid = ev.id; //ctx.store.data.lastVisit = 1617922639683; // XXX Friday Apr 09, used to test @@ -103,6 +104,12 @@ define([ reminders[uid] = []; var last = ctx.store.data.lastVisit; + + if (ev.isAllDay) { + if (ev.startDay) { ev.start = +new Date(ev.startDay); } + if (ev.endDay) { ev.end = +new Date(ev.endDay); } + } + // XXX add a limit to make sure we don't go too far in the past? var missed = useLastVisit && ev.start > last && ev.end <= now; if (ev.end <= now && !missed) {