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

Timeshift calendar issue / Recurring Google Calendar events for times when UTC date differ from local date appear at wrong time in MM #1798

Closed
simphide opened this issue Oct 30, 2019 · 65 comments

Comments

@simphide
Copy link

simphide commented Oct 30, 2019

Please only submit reproducible issues.

If you're not sure if it's a real bug or if it's just you, please open a topic on the forum: https://forum.magicmirror.builders/category/15/bug-hunt
Problems installing or configuring your MagicMirror? Check out: https://forum.magicmirror.builders/category/10/troubleshooting

When submitting a new issue, please supply the following information:

Platform: RP3B+

Node Version: 10.17.0

MagicMirror Version: v2.9

Description: Since the time shift in Germany last sunday reocurring events are in the "old time zone (-1h) in Google Calendar they are displayed correctly but on the mirror itself they are displayed wrong.

Steps to Reproduce: make new calendar with reocurring event (not whole day event) and try to display it

Expected Results: the right time

Actual Results: the time -1h

Configuration: -

Do you have any idea how to fix this? The timezones on the raspberry itself is correct

@Kugelfang666
Copy link

same problem here

@snarksandrec
Copy link

same here in PST

@georgeglessner
Copy link

georgeglessner commented Nov 4, 2019

The calendar module is using moment, and I believe that may be where the issue is coming from. I found a similar issue Brazil users are facing. #1568 may help you out as well.

@derKaY
Copy link

derKaY commented Nov 5, 2019

same here

edit the quick fix #1568 wont resolve the problem

@jsndyr
Copy link

jsndyr commented Nov 5, 2019

Same issue observed here as well. The issue presents itself on some third party calendar modules I tested as well.

Issue is occurring on two separate mirrors.

@thyed
Copy link

thyed commented Nov 6, 2019

Same here. Shift from summer time to winter time results in recurring events show up one hour too early.

@henry2man
Copy link

Can this be related to #1803 ?

@Lotusvball
Copy link

It seems that everyone is referencing other post and it has become a circular post.

#37
#1803
and this one are all related.
Along with this forum post: https://forum.magicmirror.builders/topic/9039/mmm-calendarweek/2?page=1

Is there a fix for this yer?

@kfksee
Copy link

kfksee commented Nov 24, 2019

It is also present when a repeating event crosses time change date (for example change from standard time to daylight savings time)

@MichMich MichMich changed the title Timeshift calendar issue Timeshift calendar issue / Recurring Google Calendar events for times when UTC date differ from local date appear at wrong time in MM Dec 29, 2019
@MichMich MichMich pinned this issue Dec 29, 2019
@LeGro88
Copy link

LeGro88 commented Jan 9, 2020

Same problem here.

@secastles
Copy link

After deleting the calendar files and downloading them again, the calendar now works fine for me.

Do you mean the source files or the files that the module downloads from the calendar app (e.g. Google Calendar)?

@kblankenship1989
Copy link
Contributor

PR #1884 submitted for a possible fix to this. My wife and I were having this same issue on our calendar and were able to fix ours with this workaround. Would welcome any comments / further testing on it to see if it fixes yours as well.

MichMich added a commit that referenced this issue Jan 18, 2020
fix: Issue #1798 - fixing recurrent calendar events crosstime DST
@MichMich
Copy link
Collaborator

Merged your commit (ignore the accidental revert notification). Hope this solves the issue.

@Kugelfang666
Copy link

I still encounter problems with the latest version. rolling back the calendar module to the one from 2.7.1 fixes this problem for me

@kblankenship1989
Copy link
Contributor

I still encounter problems with the latest version. rolling back the calendar module to the one from 2.7.1 fixes this problem for me

@Kugelfang666 is it the same issue listed above or a different one? There was a comment on my PR that I missed "month +1" so I am putting that fix up now so it may just be that we are off by a month. can you share an example of what you are seeing right now (snap shot / test ics that I can use to verify against, or the following details:

  • start time of event
  • recurrance
  • timezone you are in
  • what you are currently seeing and what you expect to see)

Thanks for any help you can provide to further troubleshoot

@Kugelfang666
Copy link

@kblankenship1989 i was refearing to t he issue where full day events are shown one day late. If I'm not mistaken this was related to the original -1h bug that causes full day events to be moved

@MichMich MichMich reopened this Sep 3, 2020
@MichMich
Copy link
Collaborator

MichMich commented Sep 3, 2020

Reopened

@rbouhet
Copy link

rbouhet commented Sep 9, 2020

Hi,
Just my 2 cents in case it might help.
I was having the same issue: all days recurring event were displaying one day early (Sept 12th instead of Sept 13th). I switched to develop branch (to fix something unrelated, ie Forecast only displaying 2 days) and the issue is gone.

@kleinmantara
Copy link

Same here - here a example ical from Google calender.

The calandar - wich is a series entry - is showed on the magicmirror at 09:45 not at the correct time at 11:45

BEGIN:VEVENT
DTSTART;TZID=Europe/Berlin:20200917T114500
DTSTAMP:20200909T110833Z
RECURRENCE-ID;TZID=Europe/Berlin:20200917T114500
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:GGS: Ende
TRANSP:OPAQUE
END:VEVENT
pi@magicmirror:~/MagicMirror/config $ timedatectl
      Local time: Mi 2020-09-09 13:12:13 CEST
  Universal time: Mi 2020-09-09 11:12:13 UTC
        RTC time: n/a
       Time zone: Europe/Berlin (CEST, +0200)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

@RJDaPirate
Copy link

RJDaPirate commented Sep 9, 2020 via email

@rbouhet
Copy link

rbouhet commented Sep 9, 2020

Are you willing to help this NOOB do the same? Can you provide a step by step? Thank you and have a wonderful day, Ryan Jones 443-801-1974

On Wed, Sep 9, 2020 at 3:56 AM rbouhet @.***> wrote: Hi, Just my 2 cents in case it might help. I was having the same issue: all days recurring event were displaying one day early (Sept 12th instead of Sept 13th). I switched to develop branch (to fix something unrelated, ie Forecast only displaying 2 days) and the issue is gone. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#1798 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQZO3NQUT3XZTHHC6LCFZXLSE4YKBANCNFSM4JG7OOEA .

Simply go to your MagicMirror folder in command line and checkout develop branch (the git pull might be unnecessary):
cd MagicMirror
git checkout develop

@rbouhet
Copy link

rbouhet commented Sep 9, 2020

I don't know if it's the same issue or not: I work in an international company, I'm based in CET Time Zone and some people I work with are based in PST Time Zone.
The entries I set up are showing ok (ie correct date/time), however entries set up by PST people display using PST Date/Time and are not converted to my time zone, so their time appears wrong.
Entries in ics file are like this:
CET:

DTSTART;TZID=W. Europe Standard Time:20200915T083000
DTEND;TZID=W. Europe Standard Time:20200915T093000

PST:

DTSTART;TZID=Pacific Standard Time:20200915T083000
DTEND;TZID=Pacific Standard Time:20200915T093000

I would expect the PST meeting to display "2020-09-15 17:30" but it shows up as "2020-09-15 08:30".
Am I missing something ?
Thanks

@sdetweil
Copy link
Collaborator

sdetweil commented Sep 9, 2020

@rbouhet have u tried the develop branch yet, there are fixes for the calendar problem

@rbouhet
Copy link

rbouhet commented Sep 9, 2020

@sdetweil yes, I'm on develop branch,
It fixed the issue I had on recurring google events.

The issue I just mentionned probably has a different root since it applies to both recurring and non recurring events.
I think the parsing of dates simply does not take into account the TZID part of dates from the ics, is that possible ?

@chamakura
Copy link
Contributor

I had submitted a fix related to the TZID parsing issue a while ago, but it hasn't been approved: #2086

@sdetweil
Copy link
Collaborator

sdetweil commented Sep 9, 2020

@rbouhet there was a fix for this included when I fixed the recurring not showing today problem (2121). when did u switch to develop?

try a git pull to update

there IS a problem still with ics rrule parsing in general, and why I had this issue reopened.

if u have a little ics file with header and the one event, I can add it to the ics problem

@rbouhet
Copy link

rbouhet commented Sep 9, 2020

@sdetweil git pull says I'm already up to date.
I actually installed magic mirror only yesterday, still new to it.

The ics file is my profesional calendar so I don't feel like sharing it completely is a good idea, but I can give you snippets if you want.
These display correctly:

BEGIN:VEVENT
DESCRIPTION:\n
UID:040000008200E00074C5B7101A82E0080000000070DE40F38786D601000000000000000
 010000000D2A9BA8A3668CA4ABB2CC6838268179F
SUMMARY:test
DTSTART;TZID=W. Europe Standard Time:20200910T090000
DTEND;TZID=W. Europe Standard Time:20200910T093000
CLASS:PUBLIC
PRIORITY:5
DTSTAMP:20200909T160350Z
TRANSP:OPAQUE
STATUS:CONFIRMED
SEQUENCE:0
LOCATION:
X-MICROSOFT-CDO-APPT-SEQUENCE:0
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INSTTYPE:0
X-MICROSOFT-DONOTFORWARDMEETING:FALSE
X-MICROSOFT-DISALLOW-COUNTER:FALSE
END:VEVENT
BEGIN:VEVENT
DESCRIPTION:\n
RRULE:FREQ=WEEKLY;UNTIL=20210309T080000Z;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR;WK
 ST=MO
UID:040000008200E00074C5B7101A82E008000000008001F1896B63D301000000000000000
 0100000005D0552D848712746896D6C8E2E066560
SUMMARY:Log Yesterday's Jira time
DTSTART;TZID=W. Europe Standard Time:20200609T090000
DTEND;TZID=W. Europe Standard Time:20200609T093000
CLASS:PUBLIC
PRIORITY:5
DTSTAMP:20200909T112410Z
TRANSP:TRANSPARENT
STATUS:CONFIRMED
SEQUENCE:0
LOCATION:
X-MICROSOFT-CDO-APPT-SEQUENCE:0
X-MICROSOFT-CDO-BUSYSTATUS:FREE
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INSTTYPE:1
X-MICROSOFT-DONOTFORWARDMEETING:FALSE
X-MICROSOFT-DISALLOW-COUNTER:FALSE
END:VEVENT

Not these:

BEGIN:VEVENT
UID:040000008200E00074C5B7101A82E008000000007070639B9D82D601000000000000000
 010000000690B7C3173632247A60664DDD8E0160E
SUMMARY:Not the actual summary
DTSTART;TZID=Pacific Standard Time:20200915T083000
DTEND;TZID=Pacific Standard Time:20200915T093000
CLASS:PUBLIC
PRIORITY:5
DTSTAMP:20200909T112410Z
TRANSP:OPAQUE
STATUS:CONFIRMED
SEQUENCE:0
LOCATION:
X-MICROSOFT-CDO-APPT-SEQUENCE:0
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INSTTYPE:0
X-MICROSOFT-DONOTFORWARDMEETING:FALSE
X-MICROSOFT-DISALLOW-COUNTER:FALSE
END:VEVENT

BEGIN:VEVENT
RRULE:FREQ=WEEKLY;UNTIL=20210309T200000Z;INTERVAL=1;BYDAY=TU,TH;WKST=SU
EXDATE;TZID=Pacific Standard Time:20200721T120000,20200723T120000,20200728T
 120000,20200813T120000,20200825T120000,20200903T120000
UID:040000008200E00074C5B7101A82E00800000000C8CF296B9654D601000000000000000
 01000000031C6A267A9E4A2489CEB57D709E7A37F
SUMMARY:Not the actual summary either
DTSTART;TZID=Pacific Standard Time:20200707T120000
DTEND;TZID=Pacific Standard Time:20200707T123000
CLASS:PUBLIC
PRIORITY:5
DTSTAMP:20200909T112410Z
TRANSP:TRANSPARENT
STATUS:CONFIRMED
SEQUENCE:3
LOCATION:https://bluejeans.com/7999979999
X-MICROSOFT-CDO-APPT-SEQUENCE:3
X-MICROSOFT-CDO-BUSYSTATUS:FREE
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INSTTYPE:1
X-MICROSOFT-DONOTFORWARDMEETING:FALSE
X-MICROSOFT-DISALLOW-COUNTER:FALSE
END:VEVENT

When I mean "not correctly", I mean I would expect them to be converted to local time. Here it just seems that TZID is just ignored.
Maybe my config is wrong ?

{
			module: "calendar",
			header: "meetings",
			position: "top_left",
			config: {
				timeFormat: "absolute",
				maximum: 100,
				excludedEvents: ['ooo'],
				//maximumNumberOfDays: 2,
				getRelative:0,
				urgency: 0,
				fullDayEventDateFormat: "DD/MM",
				dateFormat:"DD/MM hh:mm",
				showEnd:false,
				hideOngoing:true,
				calendars: [
					{
						symbol: "calendar-check-o",
						url: "here is my calendar url",
					}
				]
			}
		},

@sdetweil
Copy link
Collaborator

sdetweil commented Sep 9, 2020

@rbouhet could u share the calendar header? u can change the text, just not the time and timezone info. that way I can debug it

see the calendar def here #1798 (comment)
looking for similar

@rbouhet
Copy link

rbouhet commented Sep 9, 2020

Here is the header (looking at it looks pretty messy? Thanks Office I guess....)

header.txt

@sdetweil
Copy link
Collaborator

@rbouhet did u switch to the develop branch? i have tested and don't see anything wrong.. 08:45(ish) US CDT

https://www.dropbox.com/s/wmynah0n7lfwaxl/Screenshot_2020-09-10_08-52-04.png?dl=0

@rbouhet
Copy link

rbouhet commented Sep 11, 2020

@sdetweil I switched yesterday (am I suppsoed to npm install again after switching though ?)
Note on your screenshot the "Log Yesterday's Jira time" is 9AM CET, so in US CDT I wouldn't expect it to display at 9AM but 2AM since that's when the "meeting" is actually taking place.

Here is the time displayed on my side and in red the actual time of the meeting. The CET ones are displayed correctly, but I would expect the PST ones to be converted to CET since that's my time zone.
image

@sdetweil
Copy link
Collaborator

sdetweil commented Sep 11, 2020

no need to npm install, you did that already.

ok, still fighting the ics parser library ( not our code) which is returning the event date as local time, using the existing numbers. (it's supposed to return utc time)

@RJDaPirate
Copy link

RJDaPirate commented Sep 12, 2020

Work life finally got out of my way and I could return to my MagicMirror Project. I can now confirm the fix of Recurring Events time errors and a single day weather forecast is successful.

I used an used the installation script (to install MM2). Here is the fix code. Url provided below.

cd ~/Magicmirror
rm package-lock.json
git fetch origin develop:develop
git checkout develop

https://forum.magicmirror.builders/topic/13575/2-12-repeating-all-day-calendar-events-not-shown-for-today-or-weather-only-showing-2-days-and-missing-analog-clock-numbers

Thank you for your help and guidance.

@sdetweil
Copy link
Collaborator

sdetweil commented Sep 13, 2020

@rbouhet I want to make sure that I am testing correctly.. the tz listed is "W. European Standard Time", NOT CET

I added a lookup to the standard ical libs, which will translate from the MS TZ names to the IANA TZ names used everywhere else and by the javascript libs. there may be multiple locations which map to the same MS TZ name.. , for example

<!-- (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna -->
			<mapZone other="W. Europe Standard Time" territory="001" type="Europe/Berlin"/>
			<mapZone other="W. Europe Standard Time" territory="AD" type="Europe/Andorra"/>
			<mapZone other="W. Europe Standard Time" territory="AT" type="Europe/Vienna"/>
			<mapZone other="W. Europe Standard Time" territory="CH" type="Europe/Zurich"/>
			<mapZone other="W. Europe Standard Time" territory="DE" type="Europe/Berlin Europe/Busingen"/>
			<mapZone other="W. Europe Standard Time" territory="GI" type="Europe/Gibraltar"/>
			<mapZone other="W. Europe Standard Time" territory="IT" type="Europe/Rome"/>
			<mapZone other="W. Europe Standard Time" territory="LI" type="Europe/Vaduz"/>
			<mapZone other="W. Europe Standard Time" territory="LU" type="Europe/Luxembourg"/>
			<mapZone other="W. Europe Standard Time" territory="MC" type="Europe/Monaco"/>
			<mapZone other="W. Europe Standard Time" territory="MT" type="Europe/Malta"/>
			<mapZone other="W. Europe Standard Time" territory="NL" type="Europe/Amsterdam"/>
			<mapZone other="W. Europe Standard Time" territory="NO" type="Europe/Oslo"/>
			<mapZone other="W. Europe Standard Time" territory="SE" type="Europe/Stockholm"/>
			<mapZone other="W. Europe Standard Time" territory="SJ" type="Arctic/Longyearbyen"/>
			<mapZone other="W. Europe Standard Time" territory="SM" type="Europe/San_Marino"/>
			<mapZone other="W. Europe Standard Time" territory="VA" type="Europe/Vatican"/>

to simplify the mapping I take the 1st entry in the list as the IANA tz to use, which makes the adjustment to my current timezone 7 hours,
berlin (+2) to US CST (-5)
https://raw.githubusercontent.com/unicode-org/cldr/master/common/supplemental/windowsZones.xml, which should correctly adjust those to 2am US CST..

is that correct?

@sdetweil
Copy link
Collaborator

@rbouhet I have a test fix... I submitted support to the ical.js and node-ical projects

but u can test like this

cd ~/MagicMirror/node_modules
mv ical old_ical
git clone https://github.com/sdetweil/ical.js.git ical
cd ical
npm install

then run MM like normal

@sdetweil
Copy link
Collaborator

@MichMich

I see that Peter (ical) author states that his module is intended for in browser, and as such has no fs access.
peterbraden/ical.js#111, comment 2

I think we need to move to node-ical, which doesn't have this limitation. (stated in it readme)
I added the same fixes there, it takes one change to the fetcher to change the library name in the require()
I am testing, so far so good.. I will submit a pr to take node_ical from my repo til the fix is approved and merged in node_ical and published.

@rbouhet
Copy link

rbouhet commented Sep 15, 2020

Hi @sdetweil ,
I finally managed to get back to my Smart Mirror project.
Your change on node-ical does the trick and I am now seeing the time converted to my time zone as I would expect:
image
And I can confirm this works for both recurring and non recurring meetings.

@sdetweil
Copy link
Collaborator

@rbouhet great! thanks for the feedback. which module did u test, ical.js or node-ical?

@rbouhet
Copy link

rbouhet commented Sep 15, 2020

@rbouhet I have a test fix... I submitted support to the ical.js and node-ical projects

but u can test like this

cd ~/MagicMirror/node_modules
mv ical old_ical
git clone https://github.com/sdetweil/ical.js.git ical
cd ical
npm install

then run MM like normal

@sdetweil This is the one I used

@sdetweil
Copy link
Collaborator

@rbouhet thanks. that's the ical.js module, altho u said node-ical.. just making sure we are in synch..

thanks again

@sdetweil
Copy link
Collaborator

this issue can be closed

@ZakarFin
Copy link
Contributor

ZakarFin commented Oct 6, 2020

Thank you so much @sdetweil for fixing this! I recently added the family calendar on our mirror and these recurring events have not worked properly before now (the timezone issue). After updating to latest it's working perfectly!

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