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

Custom timezones are not handled #173

Open
htgoebel opened this issue Nov 29, 2021 · 0 comments
Open

Custom timezones are not handled #173

htgoebel opened this issue Nov 29, 2021 · 0 comments

Comments

@htgoebel
Copy link
Contributor

If a vCalendar defines a "custom" timezone (VTIMEZONE), this timezone is not recognized when parsing vEvents in that calendar.

"Custom" timezones are quite common in invitations send by MS Exchange, Outlook, etc. See code below for an example.

Expected behavior

Timezones defined by VTIMEZONE in a vCalendar should be recognized when parsing vEvents - at least if the timezone is defined above the event.

In the example below. the custom timezone "(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna" should be handled like according to it's definition.

How to reproduce

import vobject

TEXT = """
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VTIMEZONE
TZID:(UTC+01:00) Amsterdam\, Berlin\, Bern\, Rome\, Stockholm\, Vienna
BEGIN:STANDARD
DTSTART:16010101T030000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
UID:1-2-3-4
DTSTART;TZID="(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna"
 :20200504T110000
DTEND;TZID="(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna":2
 0200504T113000
DTSTAMP:20200303T123456Z
SUMMARY:Some Appointment
END:VEVENT
END:VCALENDAR
"""

obj = (tuple(vobject.readComponents(TEXT)))[0]
obj.prettyPrint()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant