Search code examples
icalendar

Ical import event not working event my ical file has no error


I want to import my ical event to google calender, but it is not working, It says 0 events imported, I checked with ical validator, it says no issue with the ical file, can anyone please help me to resolve this issue, here is my ical data

BEGIN:VCALENDAR VERSION:2.0 PRODID:-//hacksw/handcal//NONSGML v1.0//EN BEGIN:VTIMEZONE TZID:America/New_York BEGIN:STANDARD LOCATION:Ponton 2 Quilles | Demi-Journée (Avant-midi) DESCRIPTION:Ponton 2 Quilles | Demi-Journée (Avant-midi) DTSTART:20190619T070000Z DTEND:20190619T120000Z TZOFFSETFROM:-0400 TZOFFSETTO:-0500 TZNAME:EST SUMMARY:Ponton 2 Quilles | Demi-Journée (Avant-midi) URL:https://fassettmarine.com DTSTAMP:20190619T070000Z UID:5cf75576d13b6 END:STANDARD END:VTIMEZONE BEGIN:STANDARD LOCATION:Test Product For Tako DESCRIPTION:Test Product For Tako DTSTART:20190517T160607Z DTEND:20190518T160611Z TZOFFSETFROM:-0400 TZOFFSETTO:-0500 TZNAME:EST SUMMARY:Test Product For Tako URL:https://fassettmarine.com DTSTAMP:20190517T160607Z UID:5cf75576d13b1 END:STANDARD END:VCALENDAR


Solution

  • It looks like your properties are in random order and missing the BEGIN:VEVENT/END:VEVENT.

    iCalendar is following a fixed structure with components as containers for properties (and potentially other components). See https://www.rfc-editor.org/rfc/rfc5545#section-3.6

    So you should have something like:

    BEGIN:VCALENDAR
    ... VCALENDAR properties go here
    BEGIN:VTIMEZONE
    ... VTIMEZONE properties go here
    BEGIN:STANDARD
    ... STANDARD properties go here
    END:STANDARD
    BEGIN:DAYLIGHT
    ...
    END:DAYLIGHT
    END:VTIMEZONE
    BEGIN:VEVENT
    ... VEVENT properties go here
    END:VEVENT
    END:VCALENDAR
    

    As a matter of fact, since your event seem to be using zulu time, you can even skip the whole VTIMEZONE/STANDARD and simply go for

    BEGIN:VCALENDAR
    ... VCALENDAR properties go here
    BEGIN:VEVENT
    ... VEVENT properties go here
    END:VEVENT
    END:VCALENDAR