New to Telerik UI for Xamarin? Download free 30-day trial

Recurrence Pattern

Calendar & Scheduling component includes support for recurring events on daily, weekly, monthly and yearly basis. Exceptions to the recurrence rules are also permitted. To support this recurrence behavior, the Telerik.XamarinForms.Input.Appointment class includes the RecurrenceRule property. When an appointment is promoted into a recurring event its RecurrenceRule is set with correct RecurrencePattern.

The RecurrenceRule class is the engine for creating and evaluating recurrence rules. It has a mandatory property Pattern of type RecurrencePattern.

The purpose of this tutorial is to show you:

RecurrencePattern Class

While the RecurrenceRule class is the engine for creating and evaluating recurrence rules, the Telerik.XamarinForms.Input.RecurrencePattern class carries the main information about the occurrence.

The next several sections describe the main properties and methods exposed by the RecurrencePattern class.

Frequency

If you want to set the frequency of the recurrence, you need to set the RecurrencePattern's Frequency property. Its values are predefined in the RecurrenceFrequency enumeration, which exposes the following values:

  • Daily: Use it whenever you want the appointment to occur every day.
  • Weekly: Use it whenever you want the appointment to occur every week.
  • Monthly: Use it whenever you want the appointment to occur every month. Use it together with DaysOfMonth to mark the exact days the event occurs on.
  • Yearly: Use it whenever you want the appointment to occur every year. Use it together with DaysOfMonth and MonthOfYear to mark the exact date the event occurs on.

DaysOfWeekMask

When you want to set the days of the week of the recurrence, you need to set the RecurrencePattern's DaysOfWeekMask property. Its values are predefined in the RecurrenceDays enumeration, which exposes the following values:

  • Sunday
  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • WeekDays
  • Saturday
  • WeekendDays
  • EveryDay

RecurrenceDays.WeekDays is equivalent to RecurrenceDays.Monday | RecurrenceDays.Tuesday | RecurrenceDays.Wednesday | RecurrenceDays.Thursday | RecurrenceDays.Friday.

RecurrenceDays.WeekendDays is equivalent to RecurrenceDays.Saturday | RecurrenceDays.Sunday.

RecurrenceDays.EveryDay is equivalent to RecurrenceDays.Monday | RecurrenceDays.Tuesday | RecurrenceDays.Wednesday | RecurrenceDays.Thursday | RecurrenceDays.Friday | RecurrenceDays.Saturday | RecurrenceDays.Sunday.

Enum members are often used in logical operation to create a combination of values. Often you would need to set more than one value of the DaysOfWeekMask property.

Interval

If you want to set the number of days between each recurrence, you need to specify the RecurrencePattern's Interval property.

The default value of the RecurrencePattern's Interval property is 1.

Combining the Interval property with the DaysOfWeekMask and Frequency pattern gives you even more flexibility when creating recurring appointments.

DaysOfMonth

When you want to specify on which day of the month the appointment occurs, you need to set the DaysOfMonth property.

DayOrdinal

When you want to specify the day ordinal (first, second, third, fourth, etc.), you need to set the DayOrdinal property. For example, you may want to create an appointment that occurs on every second Monday of every third month.

MonthOfYear

When you want to specify on which month of the year the appointment occurs, you need to set the MonthOfYear property. This property is used mainly in the Yearly appointments.

MaxOccurrences

When you want to specify a limit of the occurrences for the appointment, then you need to set the MaxOccurrences property.

RepeatUntil

When you want to specify the end date of the appointment's occurrences, then you need to set the RepeatUntil property.

See Also

In this article