Need to know the possible combinations for repeating dates? – an Ical cheatsheet

The ical specification allows one to define some very interesting and complicated date recurrences.  This table (adapted from rfc-archive.org/getrfc.php?rfc=5545) was very useful when I decided to rewrite the recurrence engine part of my plugins.

Sorry about the table width – got to get that theme css fixed!

Yearly Monthly Weekly Daily Hourly Minutely Secondly
BY MONTH (1 to 31,  -1 to -31) Expand Limit Limit Limit Limit Limit Limit
BY WEEK NO (1 to 53, -1 to 53) Expand invalid invalid invalid invalid invalid invalid
BY YEAR DAY (1  to 366, -1 to -366) Expand invalid invalid invalid Limit Limit Limit
BY MONTH DAY (1 to 31, -1 to -31) Expand Expand invalid Limit Limit Limit Limit
BY DAY (MO, TU , WE, TH, FR, SA, SU) Note 2 Note 1 Expand Limit Limit Limit Limit
BY HOUR (-23 to 0 to +23) Expand Expand Expand Expand Limit Limit Limit
BY MINUTE (-59 to 0 to 59) Expand Expand Expand Expand Expand Limit Limit
BY SECOND (-60 to 0 to 60) Expand Expand Expand Expand Expand Expand Limit
BY SET POS (-366 to -1,1 to 366) Limit Limit Limit Limit Limit Limit Limit

The “By”‘s are applied in the order indicated. Limit means that the possible repeat dates are limited by the “BY” specification.  Expand means that the possible repeat dates are expanded by the BY values.  The start date will fill in any missing year, month, day, hour, minute or second values.  See the RFC 5545 Specification for examples.

Note 1:

  • Limit the dates if BYMONTHDAY is present;
  • else special expand for monthly

Note2:

  • Limit if BYYEARDAY or BYMONTHDAY is present; otherwise,
  • special expand for WEEKLY if BYWEEKNO present; otherwise,
  • special expand for MONTHLY if BYMONTH present; otherwise,
  • special expand for YEARLY

About anmari

the developer at anmari
This entry was posted in amr events, amr ical events list, Ical RFC5545 / 2445, Notes. Bookmark the permalink.