Environment
MagicMirror² version: 2.31.0
Node version: 22.15.0
npm version: 10.9.2
Platform: Raspberry pi
Which start option are you using?
npm run start
Are you using PM2?
No
Module
calendar
Have you tried disabling other modules?
Have you searched if someone else has already reported the issue on the forum or in the issues?
What did you do?
Description:
When trying to convert the hour received from the .ics file, which is in the UTC format, the module converts it to one hour later (at least for my example)
Steps to reproduce the issue:
Load an .ics file with an event where the time is set in UTC and the timezone is UTC+2, and try to view it in a timezone with UTC+3
What did you expect to happen?
To show the hour correctly in UTC+3
What actually happened?
The hour was 1 hour in the future in UTC+3
Additional comments
Solution:
The file modules/default/calendar/calendarfetcherutils.js on line 687 has a line that is commented out for calculating the eventDiff in the case described above. Furthermore, the commented line is incomplete
Line:
//eventDiff = eventDiff; //- nowDiff
Correct line:
eventDiff = nowDiff - eventDiff;
Explanation for the solution:
When calculating the diff between a timezone of smaller and greater (UTC+2 to UTC+3) we need to only get the diff from the bigger - smaller (3 - 2 = 1), before resolving this line the startMoment on line 691 was calculated using the eventDiff from line 640, which was 2, so it added 2 hours instead of 1, to a time already in UTC+2, and by doing so it converted it to an UTC+4 instead of an UTC+3.
Participation
Environment
MagicMirror² version: 2.31.0
Node version: 22.15.0
npm version: 10.9.2
Platform: Raspberry pi
Which start option are you using?
npm run start
Are you using PM2?
No
Module
calendar
Have you tried disabling other modules?
Have you searched if someone else has already reported the issue on the forum or in the issues?
What did you do?
Description:
When trying to convert the hour received from the .ics file, which is in the UTC format, the module converts it to one hour later (at least for my example)
Steps to reproduce the issue:
Load an .ics file with an event where the time is set in UTC and the timezone is UTC+2, and try to view it in a timezone with UTC+3
What did you expect to happen?
To show the hour correctly in UTC+3
What actually happened?
The hour was 1 hour in the future in UTC+3
Additional comments
Solution:
The file
modules/default/calendar/calendarfetcherutils.json line 687 has a line that is commented out for calculating theeventDiffin the case described above. Furthermore, the commented line is incompleteLine:
//eventDiff = eventDiff; //- nowDiffCorrect line:
eventDiff = nowDiff - eventDiff;Explanation for the solution:
When calculating the diff between a timezone of smaller and greater (UTC+2 to UTC+3) we need to only get the diff from the bigger - smaller (3 - 2 = 1), before resolving this line the startMoment on line 691 was calculated using the eventDiff from line 640, which was 2, so it added 2 hours instead of 1, to a time already in UTC+2, and by doing so it converted it to an UTC+4 instead of an UTC+3.
Participation