Internet Calendaring (iCalendar): Repeating Events dot ics


So Sysadmin Day is on the last Friday in July every year. I wanted to add this to a Google Calendar (GUI), but for the year 2014 (July 25) it would always mark it as the fourth Friday. This was problematic since July 2015 has five (5) Fridays. By the way, it worked just fine if I started the event in July 2015.

After some initial searching, I ran across a few resources with hints, but these were focused on the last (week)day of the year:

I decided to roll up my sleeves and give it a whirl in ics format. I started to read up on RFC 2445 “Internet Calendaring and Scheduling Core Object Specification (iCalendar)” over at IETF. After realizing it was 148 pages long I decided to create a working event in the calendar, export it, extract and modify the event, then import the event back into the calendar. This worked.

Source & How-To

And now the ICS source for System Administrator Appreciate Day:

Source Explanation

  • BEGIN/END VCALENDAR: Entire calendar encapsulation. (Hmm, I wonder if multiple calendars will work? Need to read the spec.)
  • BEGIN/END VEVENT: Single event encapsulation within the specific calendar.
  • DTSTART: The start date of the event; this is an all-day event so there is no time nor timezone.
  • DTEND: Like  DTSTART, only for when the event will end – this is the next day for an all-day event.
  • RRULE: This is the bread’n’butter. The frequency is monthly every 12 months (so once per year) on the last (-1) Friday (FR);   1FR would be the first Friday,   2FR would be the second,   -2FR would the second-to-last Friday, etc. See §4.3.10 “Recurrence Rule” on page 40 of RFC 2445 to start.
  • SUMMARY: The formal name (title) of the event.

Make It & Import It

  1. Create a new plain text file (after all, ICS/iCalendar format is just text/calendar!)
  2. Copy and paste from   BEGIN:VCALENDAR to   END:VCALENDAR.
  3. Save it as whatever you want, in this case I’ll call it   sysadminday.ics.
  4. Import to an existing Google Calendar.
  5. ????
  6. EAT:CAKE!!!!