Search code examples
phpcalendaricalendar

ICS calendar feed with Quarterly recurring events


I am working on a ICS calendar feed that will be consumed by different calendar apps. I am using PHP iCal package to generate the feed : https://github.com/markuspoerschke/iCal

The base system what provides me data for ics feed, has following types of recurring events:

Daily, Weekly, Monthly, Quarterly, Yearly

I was looking through RFC doc for this standard https://www.rfc-editor.org/rfc/rfc5545, and standard support only following repeat frequencies:

   freq        = "SECONDLY" / "MINUTELY" / "HOURLY" / "DAILY"
               / "WEEKLY" / "MONTHLY" / "YEARLY"

that means no standard way to have a quarterly recurring event.

One solution that I have in mind is to add a new event after every 3 month. However, this will add 4 separate events in a year, and not 4 recurring instance of original event added.

Is there a way to 'trick' ics to create quarterly 'recurring' events?


Solution

  • If you explore the RFC5545 spec a bit further (next page in the RECUR rule https://www.rfc-editor.org/rfc/rfc5545#page-41) , you will find that you can do many things (no 'tricks' needed). For your example:

    RRULE:FREQ=MONTHLY;INTERVAL=3
    

    as demonstrated here: http://test.icalevents.com/event/quarterly-test/.

    The INTERVAL rule part contains a positive integer representing at which intervals the recurrence rule repeats. The default value is "1", meaning every second for a SECONDLY rule, every minute for a MINUTELY rule, every hour for an HOURLY rule, every day for a DAILY rule, every week for a WEEKLY rule, every month for a MONTHLY rule, and every year for a YEARLY rule. For example, within a DAILY rule, a value of "8" means every eight days.