#40 Added TZID parsing workaround

closed-accepted
nobody
None
5
2012-10-07
2012-09-26
Kent
No

Google Calendar insists on sending back invalid TZIDs such as the following:
DTSTART;TZID=GMT+05:30:20120904T020000

According to the spec, the correct TZID value is GMT+05 since the colon isn't escaped. In practice clients read up to the last colon so this parses correctly. I changed it so that TZID parameters are reparsed so that all but the last colon are included in the parameter value. This should be safe since TZIDs are only used on date-time or time values.

An example from a piece of an event:
BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
CALSCALE:GREGORIAN
X-WR-CALNAME:work
X-WR-TIMEZONE:Asia/Calcutta
BEGIN:VTIMEZONE
TZID:GMT+05:30
X-LIC-LOCATION:GMT+05:30
BEGIN:STANDARD
TZOFFSETFROM:+0530
TZOFFSETTO:+0530
TZNAME:IST
DTSTART:19700101T000000
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTART;TZID=GMT+05:30:20120904T020000
DTEND;TZID=GMT+05:30:20120904T030000
END:VEVENT
END:VCALENDAR

Discussion

  • Kent
    Kent
    2012-09-26

     
    Attachments
  • Allen Winter
    Allen Winter
    2012-10-07

    committed in r1133
    thank you Kent

     
  • Allen Winter
    Allen Winter
    2012-10-07

    • status: open --> closed-accepted