1001Ferramentas
๐Ÿ“… Generators

Fake iCal Events Generator

Generates N fictional events in .ics format (appointments, deadlines) for Google/Outlook integration tests.

โ€”

ICS files and RFC 5545: the universal calendar format

An .ics file is plain text in the iCalendar format defined by RFC 5545 (2009, replacing the older RFC 2445). It is the lingua franca that lets a meeting invite created in Google Calendar appear correctly in Apple Calendar, Outlook, Thunderbird and Fantastical without anyone agreeing on a wire protocol โ€” every major calendar client reads and writes the same text-based grammar. A mock ICS generator is useful for QA of email parsers, for seeding development calendars with realistic data, and for testing webhook-driven workflows that import third-party events.

The minimum viable ICS file contains a VCALENDAR wrapper with one or more VEVENT blocks. The grammar is line-based, every line follows KEY:VALUE or KEY;PARAM=value:VALUE, and every key is uppercase. Required VEVENT properties are UID (globally unique identifier โ€” usually uuid@yourdomain), DTSTAMP (when the record was created), and DTSTART. Most events also include DTEND or DURATION, SUMMARY, DESCRIPTION and LOCATION.

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//YourApp//Calendar 1.0//EN
BEGIN:VEVENT
UID:[email protected]
DTSTAMP:20240501T120000Z
DTSTART:20240515T100000Z
DTEND:20240515T110000Z
SUMMARY:Team Standup
DESCRIPTION:Daily sync
LOCATION:Zoom Meeting Room
ORGANIZER;CN=Alice:mailto:[email protected]
ATTENDEE;ROLE=REQ-PARTICIPANT:mailto:[email protected]
END:VEVENT
END:VCALENDAR

Email invites, attachments and the METHOD property

The most common use case is the meeting invite emailed as an attachment with MIME type text/calendar; method=REQUEST. Gmail, Outlook and Apple Mail recognise the attachment and render "Yes/Maybe/No" buttons inline, which write a response back as a METHOD:REPLY file. Other methods include PUBLISH (a calendar feed with no RSVP), CANCEL (to remove a previously sent event), REFRESH, COUNTER and DECLINECOUNTER. For a downloadable "Add to calendar" link on a marketing page, PUBLISH is the right choice.

Timezones, recurrence and CalDAV

Timezone handling is the property most generators get wrong. Three options exist: a UTC suffix Z (DTSTART:20240515T130000Z) โ€” unambiguous but loses the user's local intent; a TZID parameter (DTSTART;TZID=America/Sao_Paulo:20240515T100000) โ€” preferred for events tied to a place; and a floating local time (no Z, no TZID) โ€” only for "every day at 9am wherever you are" cases. Brazil abolished daylight saving time in 2019, so all Brazilian zones now sit at a fixed UTC-3 year-round; older ICS files referencing BRST may still circulate.

Recurring events use the RRULE property: RRULE:FREQ=WEEKLY;BYDAY=MO,WE,FR;COUNT=12 describes "Monday/Wednesday/Friday for twelve occurrences". Exceptions go in EXDATE, additional dates in RDATE. CalDAV (RFC 4791) is the companion HTTP-based protocol that lets clients sync calendars with a server (read, write, query) โ€” it is what Apple Calendar, Thunderbird Lightning and DAVx5 use behind the scenes. Subscribed calendars are just a public .ics URL that clients refetch periodically (every 15 minutes to several hours, configurable per client).

Encoding pitfalls and library choices

The format predates JSON and shows it. Lines longer than 75 octets must be folded: split with CRLF followed by a single space at the start of the continuation. Commas, semicolons, backslashes and newlines inside values must be escaped as \, \; \\ and \n. Line endings are CRLF, not LF โ€” Outlook used to refuse files with bare LF. Mature libraries handle all of this for you: ical.js (browser and Node), node-ical, icalendar (Python), iCal4j (Java) and vobject (Python). Hand-rolling the format is fine for trivial generators; stop hand-rolling at the moment you need RRULE expansion or TZID conversion.

Frequently asked questions

Can I attach an .ics file to an email invite? Yes. Use MIME type text/calendar; method=REQUEST and Gmail/Outlook/Apple Mail will render RSVP buttons inline.

How do recurring events work? Use the RRULE property with FREQ (DAILY, WEEKLY, MONTHLY, YEARLY), optional BYDAY, BYMONTHDAY, COUNT or UNTIL. Add EXDATE for exceptions.

Do I need a timezone? Recommended for clarity. Use Z for UTC, TZID for events tied to a physical location, floating time only for "personal habit" reminders.

Can the same UID be reused? Yes โ€” that is how you update or cancel an event. Send a new VEVENT with the same UID and a higher SEQUENCE number, with METHOD:REQUEST for an update or METHOD:CANCEL to remove.

Related Tools