Work with event recurrence rules

You can use the property TimeZoneId with event items that helps to accurately calculate recurring events. The TimeZoneId property is a key string that uniquely identifies a particular time zone. It corresponds to the subkeys located in the folder HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Time Zone.

You can set the TimeZoneId property to UTC, the Sitefinity CMS user interface TimeZone, or any other string representing a valid time zone. You can find a list of valid time zone IDs in the Name of the Time Zone column in the Microsoft time zone index values.

The following sample code demonstrates how to set the TimeZoneId property to the Sitefinity CMS user interface TimeZone

When creating or editing an event, users can define the recurrence of the event. This means to duplicate the event on an hourly, daily, weekly, monthly, or even yearly basis. This section guides you through the methods for interacting with recurrence rules.
  • GetRecurrenceExpression(Telerik.Sitefinity.RecurrentRules.For developers: IRecurrenceDescriptor interface descriptor) – Returns a recurrence expression in certain format (iCal by default) calculated basing on the passed For developers: IRecurrenceDescriptor interface object.
  • TryParseRecurrenceExpression(string recurrenceExpression, out Telerik.Sitefinity.RecurrentRules.For developers: IRecurrenceDescriptor interface descriptor) - Tries to parse a recurrence expression in certain format (iCal by default) to a For developers: IRecurrenceDescriptor interface object
  • CreateDailyRecurrenceExpression(DateTime start, TimeSpan duration, DateTime recursUntil, int maxOccurrences, int interval) - Creates daily recurrence rule expression in certain format (iCal by default)
  • CreateWeeklyRecurrenceExpression(DateTime start, TimeSpan duration, DateTime recursUntil, int maxOccurrences, int interval, Telerik.Sitefinity.RecurrentRules.RecurrenceDay daysOfWeek) - Creates weekly recurrence rule expression in certain format (iCal by default)
  • CreateWeeklyRecurrenceExpression(DateTime start, TimeSpan duration, DateTime recursUntil, int maxOccurrences, int interval, Telerik.Sitefinity.RecurrentRules.RecurrenceDay daysOfWeek, DayOfWeek firstDayOfWeek) - Creates weekly recurrence rule expression in certain format (iCal by default)
  • CreateMonthlyRecurrenceExpression(DateTime start, TimeSpan duration, DateTime recursUntil, int maxOccurrences, int dayOfMonth, int interval) - Creates monthly recurrence rule expression in certain format (iCal by default)
  • CreateMonthlyRecurrenceExpression(DateTime start, TimeSpan duration, DateTime recursUntil, int maxOccurrences, int dayOrdinal, Telerik.Sitefinity.RecurrentRules.RecurrenceDay daysOfWeek, int interval) - Creates monthly recurrence rule expression in certain format (iCal by default)
  • CreateYearlyRecurrenceExpression(DateTime start, TimeSpan duration, DateTime recursUntil, int maxOccurrences, Telerik.Sitefinity.RecurrentRules.RecurrenceMonth month, int dayOfMonth) - Creates yearly recurrence rule expression in certain format (iCal by default)
  • CreateYearlyRecurrenceExpression(DateTime start, TimeSpan duration, DateTime recursUntil, int maxOccurrences, int dayOrdinal, Telerik.Sitefinity.RecurrentRules.RecurrenceMonth month, Telerik.Sitefinity.RecurrentRules.RecurrenceDay daysOfWeek) - Creates yearly recurrence rule expression in certain format (iCal by default)

Want to learn more?

Sign up for our free beginner training. Boost your credentials through advanced courses and certification.
Register for Sitefinity training and certification.

Was this article helpful?