Skip to content
Rémi Lanvin edited this page Jun 30, 2015 · 18 revisions

This library offers a small, complete, and very fast, implementation of the recurrence rules documented in the iCalendar RFC. It is heavily based on python-dateutil.

Notes

  • Unlike documented in the RFC, and like in the Python version, the starting datetime (DTSTART) is not the first recurrence instance, unless it does fit in the specified rules. This behavior makes more sense than otherwise and is easier to work with. This will only change the results if COUNT or BYSETPOS are used.
  • The current algorithm to compute occurrences is faster at lower frequencies and slower at higher the frequencies. So YEARLY is faster that MONTHLY which is faster than WEEKLY and so on. So if you want to achieve the fastest calculation time, whenever possible, try to use the lowest possible frequency. For example, to get "every day in january" it is slightly faster to write ['freq' => 'yearly','bymonth' => 1,'bymonthday' => range(1,31)] rather than ['freq' => 'daily','bymonth' => 1].
  • Computing all occurrences of rule might get noticeably slow with very high frequencies (MINUTELY or SECONDELY) if the rule last a long period of time (such as many years).
  • Some perfectly RFC-compliant rules are actually impossible and will produce no result. For example "every year, on week 40, in February" (week 40 will never occur in February). In a cases like that, the library will still try to find occurrences before eventually returning an empty set.
Clone this wiki locally