Question

I read this answer here which explains how to output an ical file of scheduled items:

How can I use PHP to dynamically publish an ical file to be read by Google Calendar?

My question is what is the ical format for recurring events? Let's say i want to schedule a team meeting every monday at 10 am. What is the ical format for a repeating schedule? Or do i need to print X number of events into the future?

Was it helpful?

Solution

the ical format is defined by the RFC5545: http://tools.ietf.org/html/rfc5545

in your case you will need to define only one event and make use of the FREQ property (FREQ=WEEKLY) and COUNT property (COUNT=X)

RRULE:FREQ=WEEKLY;BYDAY=MO;COUNT=X

see http://tools.ietf.org/html/rfc5545#section-3.3.10 for more details.

OTHER TIPS

Let's say I want to schedule a team meeting every monday at 10 am. What is the ical format for a repeating schedule?

 DTSTART:20121022T100000
 RRULE:FREQ=WEEKLY;BYDAY=MO

specifies a start date of 10am on a Monday, and the RRULE part specifies that it recurs weekly.

You need to put this inside a VEVENT as specified in RFC 2445.

Since no timezone is specified, Google will assume the primary timezone for the calendar to which you are uploading this event.

You do not need to specify a count or a termination date. Google calendar has some internal limit on the number of instances of a recurring event that you can specialize, but unless your team meets regularly for centuries you shouldn't ever run into it.

You can use the RRULE and FREQ properties to accomplish this as described in RFC5545. In your case it would look something like this:

DTSTART:20121029T100000Z
RRULE:FREQ=WEEKLY;BYDAY=MO;UNTIL=20131028T110000Z

You can also set other ways to limit the number of occurances (like number of recurring events) or just have it repeat forever. However, putting a reasonable limit instead of infinite repetitions is more polite to your users if you ask me.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top