The shape of the file
A VCALENDAR holds a VERSION, a PRODID and one or more components. An event is a VEVENT with a UID, a DTSTAMP, a DTSTART and usually a DTEND, SUMMARY and DESCRIPTION. Properties are NAME;PARAM=value:value and the value is text with three escapes: a backslash, a semicolon and a comma, plus a literal newline written as \n rather than an actual break. Getting the escaping wrong is silent: the file imports and the description is cut at the first comma.
Folding is measured in octets, not characters
A line longer than seventy-five octets is split, and the continuation begins with a single space or tab. Octets means UTF-8 bytes, so a Korean description folds at about twenty-five characters rather than seventy-five, and a folding routine that counts characters will produce a line a strict parser rejects. The folding must not split a multi-byte character either, which is the second thing a hand-written encoder gets wrong. This page counts bytes and folds between characters.
| Mistake | What the calendar does | The fix |
| LF instead of CRLF | Ignores the file or the last property | Every line ends CRLF |
| No UID | Imports, then duplicates on a second import | A stable UID per event |
| DTEND equal to DTSTART on an all-day event | Shows a zero-day event, or drops it | DTEND is the day after |
| Unescaped comma in DESCRIPTION | Text cut at the comma | Escape it as \, |
| COUNT and UNTIL together | Client-dependent series length | One or the other |
RRULE is a set of choices, not a sentence
A rule names a frequency and then narrows it with parts: an interval, a set of weekdays, days of the month, months of the year, and an end. The narrowing is not independent: BYDAY inside a monthly rule means "every matching weekday in the month" unless a number is prefixed, in which case it means the second Tuesday or the last Friday. BYMONTHDAY inside a weekly rule is meaningless and is ignored rather than rejected, which is how a rule that looks right produces dates nobody expected. The parts this page offers are the ones with one meaning.
The end of a series has three forms
An endless rule, a count, or a date. An endless rule is what a subscription wants and what a single import handles badly, because a client must expand it lazily forever. COUNT counts occurrences that match the rule, not calendar days, so COUNT=8 on a weekly rule is eight weeks. UNTIL is a moment in UTC, and a rule with an UNTIL date but a local DTSTART is a rule whose last occurrence depends on the zone: the same rule can include or exclude one date depending on where it is read.
What a file cannot do
An .ics file carries no IDs from the calendar it will land in, no reminders that the operating system already owns, and no guarantee that an attendee will be invited: an ATTENDEE property asks a server to send, and a file on a phone has no server. Importing is a one-way act that a calendar is free to interpret, which is why the file has to be right before it leaves rather than after it is refused.
For the time arithmetic behind a recurrence, Pikkola Time converts a timestamp across zones. For the repetition syntax a server uses instead, Pikkola Cron is the other side of the same idea.