Setting the Repeat Rule

For an event to occur repetitively, such as a weekly progress meeting, you need to set a repeat rule. You can set the repeat frequency as daily, weekly, monthly by day (for example every Monday of first week), monthly by date (for example 25th of every month), yearly by day (for example every Monday of first week of October) and yearly by date, to a calendar entry.

A repeat rule can be set by passing a TCalRRule to CCalEntry::SetRRule(). TCalRRule allows you to set any of the following iCal properties:

  • FREQ (rule type)

  • DTSTART (start date)

  • UNTIL (end date)

  • COUNT (number of instances)

  • INTERVAL (interval between instances)




  • WKST (start day of week)

You can set the repeat rule as follows:

// set the repeat definition type
TCalRRule rrule = TCalRRule(EWeekly);
// set interval between each instance 
// set the start Time 
TCalTime startTime; 
startTime.SetTimeLocalL(TDateTime(2005, EJuly, 26, 0, 0, 0, 0)); 
// set the end Time 
TCalTime endTime; 
endTime.SetTimeLocalL(TDateTime(2007, EAugust, 28, 14, 0, 0, 0)); 
// set the repeat rule in the calendar entry 
// You can set the time zone rules for the entry’s repeat rules
entry->SetTzRulesL(*tzrule); // tzrule object is of CTzRules type