Read the statement by Michael Teeuw here.
Recurring calendar events are off by a day
-
@justinreimer yeh, SO much fun… looks like a chnage to the lower level lib has ‘fixed’ the problem I had to work around 3 years ago…
so to test
edit ~/MagicMirror/modules/default/calendar/calendarutils.js
and coment out (add // to the beginning of the line)lines 338 and 350
both say (one has a minus sign, one a plus sign before Math( )date = new Date(date.getTime() - Math.abs(24 * 60) * 60000);
and lines 366 and 378
both say (one has a minus sign, one a plus sign before Math( )date = new Date(date.getTime() + Math.abs(24 * 60) * 60000);
-
So the good news is that commenting out the above lines did fix the issue with the event I posted about above.
The bad news is that it caused issues with other events that were previously working.
Here’s the VEVENT data associated with one of the newly mis-behaving events
BEGIN:VEVENT CREATED:20220811T165129Z UID:C8B93B02-3057-41F6-A69A-F4959C342E02 RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE DTEND;TZID=America/Los_Angeles:20220808T210000 TRANSP:OPAQUE X-APPLE-TRAVEL-ADVISORY-BEHAVIOR:AUTOMATIC SUMMARY:My Custom Event LAST-MODIFIED:20220811T165146Z DTSTAMP:20220811T165147Z DTSTART;TZID=America/Los_Angeles:20220808T190000 SEQUENCE:1 END:VEVENT
This new event that is now wrong is a weekly repeating event that is scheduled for every Monday and Wednesday at 7:00 PM. However, the calendar module on the Magic Mirror is now showing it happening every Sunday and Tuesday at 7:00 PM.
-
@justinreimer that’s what I was afraid of.
put them back. let me look at it some more
thanks for the other event
-
@justinreimer the problem is the library that handles the recurring events
sometimes it gets its date/times messed up , the new event
if got 2 events per week, BUT used the correct DATE and the UTC TIME, and THAT turns into the day before in LA timezone. which is what the code we commented out fixes…[11.08.2022 12:12.47.262] [DEBUG] start: Mon Aug 08 2022 19:00:00 GMT-0700 (Pacific Daylight Time) [11.08.2022 12:12.47.263] [DEBUG] end:: Mon Aug 08 2022 21:00:00 GMT-0700 (Pacific Daylight Time) [11.08.2022 12:12.47.264] [DEBUG] duration: 7200000 [11.08.2022 12:12.47.264] [DEBUG] title: My Custom Event [11.08.2022 12:12.47.265] [DEBUG] Search for recurring events between: Thu Aug 11 2022 12:12:47 GMT-0700 (Pacific Daylight Time) and Thu Aug 10 2023 23:59:59 GMT-0700 (Pacific Daylight Time) [11.08.2022 12:12.47.300] [DEBUG] Title: My Custom Event, with dates: ["2022-08-15T02:00:00.000Z","2022-08-17T02:00:00.000Z",
except the 1st event
[11.08.2022 12:12.46.698] [DEBUG] start: Thu Aug 11 2022 19:00:00 GMT-0700 (Pacific Daylight Time) [11.08.2022 12:12.46.698] [DEBUG] end:: Thu Aug 11 2022 19:15:00 GMT-0700 (Pacific Daylight Time) [11.08.2022 12:12.46.699] [DEBUG] duration: 900000 [11.08.2022 12:12.46.699] [DEBUG] title: This is a test Event [11.08.2022 12:12.46.700] [DEBUG] Search for recurring events between: Thu Aug 11 2022 12:12:46 GMT-0700 (Pacific Daylight Time) and Thu Aug 10 2023 23:59:59 GMT-0700 (Pacific Daylight Time) [11.08.2022 12:12.46.782] [DEBUG] Title: This is a test Event, with dates: ["2022-08-12T02:00:00.000Z","2022-08-19T02:00:00.000Z",
is processed correctly…
unfortunately i cannot tell that one is ok, and the other is not.
if u take off the BYDAY on the second event then its ok…------
hm… try this …uncomment, and add this line above each line you had commented out
if(curEvent.rrule.origOptions.byweekday !== undefined)
this checks to see if the vevent rrule explicitly specified byday… if so, it corrects…
otherwise notseems to work for me
-
@sdetweil Yep that seems to have fixed it. Checked the next 30 events on my calendar, and they all seem to match up now. Thanks!
-
@justinreimer I have submitted fix https://github.com/MichMich/MagicMirror/pull/2905
for the next release -
-