Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All events in standard calendar module are shown in UTC following the update to MM 2.12.0 #2068

Closed
eliahru opened this issue Jul 3, 2020 · 13 comments

Comments

@eliahru
Copy link

eliahru commented Jul 3, 2020

I found a bug in MagicMirror

Following the update to 2.12.0 all Google Calendar events are shown incorrectly.

Platform: Raspberry Pi 3

Node Version: 10.20.1

MagicMirror Version: 2.12.0

Description:
I use Google calendars configured in MM standards "calendar" module via .ical URLs.
My local timezone is MSK (UTC+3, no daylight savings time).
Following the update to MM version 2.12.0, all events are shown as they start/finish 3 hours earlier. I.e. if I cave an event that starts at "15:00" local time, it is now shown in MM as starting at "12:00". It seems that UTC timezone is used instead of local one.

Configuration:
Skipping this step for now as config.js file contains nothing related to time-zones.

@MichMich
Copy link
Collaborator

MichMich commented Jul 4, 2020

It might have something to do with this PR: 6d60baa#diff-4163d379a03c855907bc93633f16efa0

@rejas: Any idea if this could be the case?

@eliahru
Copy link
Author

eliahru commented Jul 4, 2020

Made some more tests. It looks that the problem is impacting only recurring events, one-time events are shown correctly.

@MichMich
Copy link
Collaborator

MichMich commented Jul 4, 2020

#2057

@MichMich
Copy link
Collaborator

MichMich commented Jul 4, 2020

Ok, I've merged #2057, could you check if this fixes the issue by running the develop branch?

git checkout develop && git pull

@eliahru
Copy link
Author

eliahru commented Jul 6, 2020

The given merge makes the situation for me event worse, the difference with real time becomes larger.
But it works fine if I remove the minus sign for the "offset" variable:

// correct data for the current timezone
var offset = -(new Date().getTimezoneOffset() * 60 * 1000);
             ^ remove this one
event.startDate = event.startDate - offset;
event.endDate = event.endDate - offset;

@eliahru
Copy link
Author

eliahru commented Jul 6, 2020

After applying #2071 everything seems to be working fine.

@rejas
Copy link
Collaborator

rejas commented Jul 6, 2020

Is there a test for this scenario in the code by the way?

@mpegram3rd
Copy link

Just wanted to weigh in to confirm:

  • It was happening with recurring events only
  • The fix seems to have worked (pulled develop.. looking good).

Thank you! This is the most crucial thing on my MM at the moment since I use it to track work meetings.

@MichMich
Copy link
Collaborator

MichMich commented Jul 7, 2020

Thanks for your confirmation. I'm closing this issue for now. Let me know if I need to reopen this issue.

@MichMich MichMich closed this as completed Jul 7, 2020
@sdetweil
Copy link
Collaborator

sdetweil commented Jul 8, 2020

you should leave these fixed in develop issues open for people to search against, close them on actual release to master

@khassel
Copy link
Collaborator

khassel commented Jul 8, 2020

or think about bugfix releases. We will have discussions about this issue and weather bug from now on until next release (here, in the forum, in discord). And telling people to use develop branch or wait 3 months is no solution. Same thing was the socket.io bug in the release before.

May it is a solution to make one bugfix release 2 weeks after main release (if there are such bugs).

@sdetweil
Copy link
Collaborator

sdetweil commented Jul 8, 2020

I agree, but Mich didn't want to do point releases, even tho there is numbering for them

@gvansteeg
Copy link

Hallo,
I’m new to MagicMirror. I have got the same issue as described above; recurring all day events are showing 1 day early. Ween I change the event to only occur once, it’s showing the correct day.
I,m using a raspberry pi with MagicMirrorOs and have timezone: Europe Amsterdam.
MagicMirror version is: 2.17.1. I’m using iCloud calendar.
It seems like it has something to do with DST, events in October are ok, events in November are showing wrong date.
Any idea how I can resolve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants