jazzband / icalevents

Python module for iCal URL/file parsing and querying.
MIT License
160 stars 72 forks source link

ValueError: RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware #71

Closed MasaYan24 closed 2 years ago

MasaYan24 commented 4 years ago

It might be the problem of google calendar or other ics handling applications.

I found an event that is repeatedly scheduled. And I got an error when I load the calendar like icalevents.icalevents.events(url=https://xx/x/xx.ics, start=start, end=end) where start and end are datetime.datetime object: ValueError: RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware

If I read the *.ics file, there is an event which is something like this:

DTSTART;TZID=Asia/Tokyo:20200610T103000
DTEND;TZID=Asia/Tokyo:20200610T110000
RRULE:FREQ=WEEKLY;WKST=SU;UNTIL=20201130;BYDAY=WE
DTSTAMP:20200903T041214Z
ORGANIZER;CN=xxxx@yyy.com:mailto:xxx@yyy.com
UID:ffwfjwofjiewfjiwegjaweojfowejfowjfowejfwafjwe@google.com
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=Some One;X-NUM-GUESTS=0:mailto:fff@ssss.com
CREATED:20200304T015134Z
DESCRIPTION: description
LAST-MODIFIED:20200902T120609Z
LOCATION: somewhere
SEQUENCE:2
STATUS:CONFIRMED
SUMMARY: repeating events name
TRANSP:OPAQUE
ATTACH;FILENAME=hey hey hey;FMTTYPE=application/vnd.google-ap
 ps.document:https://docs.google.com/a/xxx/document/d/1fjwfwfjwoefijowefjeowfjEME/edit?usp=drive_web
END:VEVENT

As mentioned by the error message, UNTIL is 20201130 which is only date information not datetime with timezone. But can we assume date object as date + datetime.datetime.time(0, 0) in the same timezone? OR prepare a method to fix the *ics?

Zachu commented 3 years ago

Seems to be broken on the latest 0.1.25 release. I can reproduce it on that but I have it working on 0.1.24