From a60e1078f9eeb6c4f47f2ae43a824e94a050ace3 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 13 Apr 2021 16:54:46 +0200 Subject: [PATCH] Fix reminders for all day events --- www/common/notifications.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/www/common/notifications.js b/www/common/notifications.js index 2c6a4b24c..7a64815cc 100644 --- a/www/common/notifications.js +++ b/www/common/notifications.js @@ -483,6 +483,9 @@ define([ var nowDateStr = new Date().toLocaleDateString(); var startDate = new Date(start); + if (msg.isAllDay && msg.startDay) { + startDate = new Date(msg.startDay); + } // Missed events if (start < now && missed) { @@ -493,9 +496,6 @@ define([ return Messages._getKey('reminder_now', [title]); } // In progress, is all day - // XXX fix this... - // XXX start and end time may not matter... - // XXX and timezone? if (start < now && msg.isAllDay) { return Messages._getKey('reminder_inProgressAllDay', [title]); } @@ -506,6 +506,11 @@ define([ // Not started yet + // No precise time for allDay events + if (msg.isAllDay) { + return Messages._getKey('reminder_date', [title, startDate.toLocaleDateString()]); + } + // In less than an hour: show countdown in minutes if ((start - now) < 3600000) { var minutes = Math.round((start - now) / 60000);