Skip to main content

Recurrence - Yearly (examples)

  • 2 minutes to read

Interval

Range

RecurrenceInfo.WeekOfMonth_Yearly_None

RecurrenceInfo.WeekOfMonth_Yearly_Last

RecurrenceRange.NoEndDate

RecurrenceRange.OccurrenceCount

RecurrenceRange.EndByDate

  1. An appointment occurs every 7th day of February every year. Four occurrences are specified.

    RRULE:FREQ=YEARLY;COUNT=4;BYMONTHDAY=7;BYMONTH=2
    
    apt.RecurrenceInfo.Type = RecurrenceType.Yearly;
    apt.RecurrenceInfo.Periodicity = 1;
    apt.RecurrenceInfo.Start = apt.Start;
    apt.RecurrenceInfo.Month = 2;
    apt.RecurrenceInfo.WeekOfMonth = WeekOfMonth.None;
    apt.RecurrenceInfo.DayNumber = 7;
    apt.RecurrenceInfo.Range = RecurrenceRange.OccurrenceCount;
    apt.RecurrenceInfo.OccurrenceCount = 4;
    
  2. An appointment occurs the second Monday in August for 2 years. The chain has no end date.

    RRULE:FREQ=YEARLY;INTERVAL=2;BYDAY=MO;BYMONTH=8;BYSETPOS=2
    
    apt.RecurrenceInfo.Type = RecurrenceType.Yearly;
    apt.RecurrenceInfo.Periodicity = 2;
    apt.RecurrenceInfo.Start = apt.Start;
    apt.RecurrenceInfo.Month = 8;
    apt.RecurrenceInfo.WeekOfMonth = WeekOfMonth.Second;
    apt.RecurrenceInfo.WeekDays = WeekDays.Monday;
    apt.RecurrenceInfo.Range = RecurrenceRange.NoEndDate;
    
  3. An appointment occurs on the last day of every year for 10 years.

    RRULE:FREQ=YEARLY;UNTIL=20261103T080000Z;BYDAY=SU,MO,TU,WE,TH,FR,SA;BYMONTH=12;BYSETPOS=-1
    
    apt.RecurrenceInfo.Type = RecurrenceType.Yearly;
    apt.RecurrenceInfo.Periodicity = 1;
    apt.RecurrenceInfo.Start = apt.Start;
    apt.RecurrenceInfo.Month = 12;
    apt.RecurrenceInfo.WeekOfMonth = WeekOfMonth.Last;
    apt.RecurrenceInfo.WeekDays = WeekDays.EveryDay;
    apt.RecurrenceInfo.Range = RecurrenceRange.EndByDate;
    apt.RecurrenceInfo.End = apt.RecurrenceInfo.Start.AddYears(10);
    
See Also