Class SchedulerRecurrenceManager
Represents a helper for handling the recurrence appointments.
Inheritance
Namespace: Syncfusion.Maui.Scheduler
Assembly: Syncfusion.Maui.Scheduler.dll
Syntax
public static class SchedulerRecurrenceManager : Object
Methods
GenerateRRule(SchedulerRecurrenceInfo, DateTime, DateTime)
Method to generates the recurrence rule based on the given recurrence properties, the start date and end date of the recurrence appointments.
Declaration
public static string GenerateRRule(SchedulerRecurrenceInfo recurrenceProperties, DateTime appStartTime, DateTime appEndTime)
Parameters
Type | Name | Description |
---|---|---|
SchedulerRecurrenceInfo | recurrenceProperties | The recurrence properties for an appointment. |
System.DateTime | appStartTime | The start time of recurrence appointment. |
System.DateTime | appEndTime | The end time of recurrence appointment. |
Returns
Type | Description |
---|---|
System.String | The recurrence rule string. |
Examples
The below examples shows, how to use the generate rrule method of the SfScheduler.
var recurrenceProperties = new SchedulerRecurrenceInfo();
recurrenceProperties.RecurrenceType = SchedulerRecurrenceType.Daily;
recurrenceProperties.Interval = 2;
recurrenceProperties.RecurrenceCount = 3;
var startTime = DateTime.Today.AddHours(9);
var endTime = DateTime.Today.AddHours(10);
var rRule = SchedulerRecurrenceManager.GenerateRRule(recurrenceProperties, startTime, endTime);
GetDateTimeOccurrences(String, DateTime, Nullable<DateTime>, Nullable<DateTime>, Nullable<DateTime>, DayOfWeek)
Method to get date time collection at which the recurrence appointment will occur.
Declaration
public static List<DateTime> GetDateTimeOccurrences(string rRule, DateTime recurrenceStartDate, Nullable<DateTime> specificStartDate = null, Nullable<DateTime> specificEndDate = null, Nullable<DateTime> recurrenceEndDate = null, DayOfWeek firstDayOfWeek)
Parameters
Type | Name | Description |
---|---|---|
System.String | rRule | The rrule. |
System.DateTime | recurrenceStartDate | The recurrence Start Date. |
System.Nullable<System.DateTime> | specificStartDate | The specific start date. |
System.Nullable<System.DateTime> | specificEndDate | The specific end date. |
System.Nullable<System.DateTime> | recurrenceEndDate | The recurrence end date. |
System.DayOfWeek | firstDayOfWeek | An optional parameter that specifies the first day of the week for filtering the recurrence date-time collection. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<System.DateTime> | The recurrence date time collection. |
Examples
The below examples shows, how to get the date time occurrences method of the SfScheduler.
var dateTime = DateTime.Today.AddHours(10);
var recurrenceRule = "FREQ=DAILY;INTERVAL=1;COUNT=3";
var dateCollection = SchedulerRecurrenceManager.GetDateTimeOccurrences(recurrenceRule, dateTime);
GetOccurrenceAppointment(SfScheduler, Object, DateTime, DayOfWeek)
Returns the occurrence appointment for the given pattern appointment at the specified date. If there is no appointment occurring on the date specified, null is returned.
Declaration
public static SchedulerAppointment GetOccurrenceAppointment(SfScheduler scheduler, object patternAppointment, DateTime occurrenceDate, DayOfWeek firstDayOfWeek)
Parameters
Type | Name | Description |
---|---|---|
SfScheduler | scheduler | The scheduler object. |
System.Object | patternAppointment | The pattern appointment. |
System.DateTime | occurrenceDate | The occurrence date. |
System.DayOfWeek | firstDayOfWeek | An optional parameter that specifies the first day of the week for filtering the occurrence appointments. |
Returns
Type | Description |
---|---|
SchedulerAppointment | The occurrence appointment. |
GetPatternAppointment(SfScheduler, Object)
Returns the Pattern appointment for the provided occurrence appointment.
Declaration
public static object GetPatternAppointment(SfScheduler scheduler, object occurrenceAppointment)
Parameters
Type | Name | Description |
---|---|---|
SfScheduler | scheduler | The scheduler object. |
System.Object | occurrenceAppointment | The occuurence appointment. |
Returns
Type | Description |
---|---|
System.Object | The pattern appointment. |
ParseRRule(String, DateTime)
Returns the recurrence properties based on the given recurrence rule and the recurrence start date.
Declaration
public static SchedulerRecurrenceInfo ParseRRule(string rRule, DateTime recStartDate)
Parameters
Type | Name | Description |
---|---|---|
System.String | rRule | The recurrence rule. |
System.DateTime | recStartDate | The recurrence start date. |
Returns
Type | Description |
---|---|
SchedulerRecurrenceInfo | The recurrence properties. |
Examples
The below examples shows, how to use the parse rrule method of the SfScheduler.
var dateTime = DateTime.Today.AddHours(10);
var recurrenceRule = "FREQ=DAILY;INTERVAL=1;COUNT=3";
var recurrenceProperties = SchedulerRecurrenceManager.ParseRRule(recurrenceRule, dateTime);