Recurring Events in .NET MAUI Scheduler—An Overview | Syncfusion Blogs
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (163).NET Core  (29).NET MAUI  (81)Angular  (81)ASP.NET  (50)ASP.NET Core  (79)ASP.NET MVC  (88)Azure  (38)Blazor  (160)DocIO  (23)Essential JS 2  (89)Essential Studio  (180)File Formats  (33)Flutter  (123)JavaScript  (190)Microsoft  (114)PDF  (68)React  (65)Succinctly series  (128)Syncfusion  (634)TypeScript  (32)Uno Platform  (3)UWP  (4)Vue  (40)Webinar  (35)Windows Forms  (59)WinUI  (56)WPF  (140)Xamarin  (157)XlsIO  (26)Other CategoriesBarcode  (5)BI  (29)Bold BI  (5)Build conference  (6)Business intelligence  (54)Button  (4)C#  (121)Chart  (59)Cloud  (13)Company  (445)Dashboard  (8)Data Science  (3)Data Validation  (6)DataGrid  (56)Development  (418)Doc  (7)DockingManager  (1)eBook  (96)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (24)Extensions  (19)File Manager  (4)Gantt  (14)Gauge  (11)Git  (4)Grid  (28)HTML  (12)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (333)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (33)Performance  (10)PHP  (1)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (8)Road Map  (11)Scheduler  (39)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (23)Solution Services  (3)Spreadsheet  (11)SQL  (8)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (95)UI  (238)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (23)Visual Studio Code  (17)Web  (396)What's new  (229)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
Recurring Events in .NET MAUI Scheduler—An Overview

Recurring Events in .NET MAUI Scheduler—An Overview

The .NET MAUI Scheduler is a tool for scheduling events in a .NET MAUI application. It supports scheduling recurring events, which are regularly or periodically occurring appointments or events. Scheduler’s API has been designed with simplicity and ease of use in mind, so that anyone can add recurring events to their project with just a few API calls. Supported by a robust internal scheduling engine, Scheduler gives you all the APIs you need to build simple and easy-to-maintain schedules.

Let’s see how to create and customize recurrence appointments in the .NET MAUI Scheduler.

Note: If you are new to this control, refer to the .NET MAUI Scheduler getting started documentation before proceeding.

Recurrence Rule

The Scheduler control uses the recurrence rule (string) to specify the recurrence details of an appointment. The recurrence rule specifies the recurrence frequency, interval, range, and position details.

Recurrence pattern

The pattern specifies the frequency or type of appointment: daily, weekly, monthly, and yearly.

Interval

Specify the interval between consecutive occurrences of the recurring appointment.

Range

The time range in which an appointment recurs. The range value is determined by the recurrence rule’s number of instances (count) or the end date (until). The recurring appointment is considered a never-ending appointment when the range is not specified.

Position details

The position (the day of the week, week of the month, month of the year) is specified and used on weekly, monthly, and yearly recurrence types.

Recurrence Types

Recurrence is the base term describing a repeating pattern. Business people use the concept of regular assignment of tasks or recurring events on certain days of the week, month, or even annually, like Jan. 1 every year.

Daily recurrence type

An appointment repeats daily with a specified day interval within a set date range. Following are some examples of daily recurrences.

Rule Description
FREQ=DAILY;INTERVAL=1;COUNT=5 Repeats the appointment for 5 consecutive days.
FREQ=DAILY;INTERVAL=1;UNTIL=20221225 Repeats the appointment every day until the specified end date.
FREQ=DAILY;INTERVAL=2 Repeats the appointment every 2 days with no end date.

Weekly recurrence type

An appointment repeats on a specified weekday with a specified week interval within the specified date range. Following are some examples of weekly recurrences.

Rule Description
FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE;COUNT=5 Repeats the appointment 5 times for specified weekdays (Monday, Wednesday) of every week.
FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE;UNTIL=20221225 Repeats the appointment on specified weekdays (Monday, Wednesday) of every week until the specified end date.
FREQ=WEEKLY;INTERVAL=2;BYDAY=MO,WE Repeats the appointment on specified weekdays (Monday, Wednesday) every 2 weeks with no end date.

Monthly recurrence type

An appointment repeats on a specified day of the month or weekday of a specified week position with a specified month interval within a set date range. Following are some examples of monthly recurrences.

Rule Description
FREQ=MONTHLY;BYMONTHDAY=3;INTERVAL=1;COUNT=5 Repeats the appointment 5 times on a specified day (3rd) of every month.
FREQ=MONTHLY;INTERVAL=1;BYDAY=MO;BYSETPOS=2;UNTIL=20221225 Repeats the appointment on a specified weekday (Monday) of a specified week (week 2) of every month until the specified end date.
FREQ=MONTHLY;INTERVAL=2;BYDAY=MO;BYSETPOS=2 Repeats the appointment on a specified weekday (Monday) of a specified week (week 2) every 2 months with no end date.

Yearly recurrence type

Schedule and repeat an appointment on a specified day of a month or weekday of specified week position of a month with a specified year interval within a specified date range.

Rule Description
FREQ=YEARLY;BYMONTHDAY=16;BYMONTH=6;INTERVAL=1;COUNT=5 Repeats the appointment 5 times for a specified day (16th) in the same month (June) of every year.
FREQ=YEARLY;BYDAY=SU;BYSETPOS=3;BYMONTH=8;INTERVAL=1;UNTIL=20251225 Repeats the appointment on a specified weekday (Sunday) of a specified week (week 3) in a specified month (August) for every year until the specified end date.
FREQ=YEARLY;BYDAY=SU;BYSETPOS=3;BYMONTH=8;INTERVAL=2; Repeats the appointment on a specified weekday (Sunday) of a specified week (week 3) in a specified month (August) every two years with no end date.

Example

SfScheduler scheduler = new SfScheduler();
scheduler.View = SchedulerView.Week;
var appointment = new ObservableCollection<SchedulerAppointment>();

//Adding scheduler appointment in the scheduler appointment collection.
appointment.Add(new SchedulerAppointment()
{
    StartTime = DateTime.Today.Date.AddHours(9),
    EndTime = DateTime.Today.Date.AddHours(11),
    Subject = "Daily scrum meeting",
    RecurrenceRule = "FREQ=DAILY;INTERVAL=1;COUNT=10"
});

//Adding the scheduler appointment collection to the AppointmentsSource of .NET MAUI Scheduler.
scheduler.AppointmentsSource = appointment;
this.Content = scheduler;
Daily Recurrence Type in .NET MAUI Scheduler
Daily Recurrence Type in .NET MAUI Scheduler

Note: For more details, refer to the Recurrence appointments in the .NET MAUI Scheduler documentation.

Recurrence Exception Appointment

The Scheduler control provides support to restrict (change start time, end time, and appointment details) occurrences and remove an occurrence of a repeating appointment with a recurrence exception.

Deleting a recurring appointment

The RecurrenceExceptionDates property in an appointment is used to remove the occurrence on specified dates.

Refer to the following code example.

SfScheduler scheduler = new SfScheduler();
scheduler.View = SchedulerView.Week;
var appointment = new ObservableCollection<SchedulerAppointment>();

//Adding scheduler appointment in the scheduler appointment collection.
appointment.Add(new SchedulerAppointment()
{
    StartTime = DateTime.Today.Date.AddHours(9),
    EndTime = DateTime.Today.Date.AddHours(11),
    Subject = "Daily scrum meeting",
    RecurrenceRule = "FREQ=DAILY;INTERVAL=1;COUNT=10",
    RecurrenceExceptionDates = new ObservableCollection<DateTime> { DateTime.Today.AddDays(1) },
});

//Adding the scheduler appointment collection to the AppointmentsSource of .NET MAUI Scheduler.
scheduler.AppointmentsSource = appointment;
this.Content = scheduler;
Deleting an occurrence of a recurring appointment
Deleting an occurrence of a recurring appointment

Modifying an occurrence of an appointment

The RecurrenceExceptionDates and RecurrenceId properties in an appointment are used to change the occurrence appointment details without removing the appointment on a specified date.

Refer to the following code example.

SfScheduler scheduler = new SfScheduler();
scheduler.View = SchedulerView.Week;
var appointment = new ObservableCollection<SchedulerAppointment>();

//Adding scheduler appointment in the scheduler appointment collection.
appointment.Add(new SchedulerAppointment()
{
     Id = 1,
     StartTime = DateTime.Today.Date.AddHours(9),
     EndTime = DateTime.Today.Date.AddHours(11),
     Subject = "Daily scrum meeting",
     RecurrenceRule = "FREQ=DAILY;INTERVAL=1;COUNT=10",
     RecurrenceExceptionDates = new ObservableCollection<DateTime> { DateTime.Today.AddDays(1) },
});

//Adding exception appointment in the scheduler appointment collection.
Appointment.Add(new SchedulerAppointment()
{
     Id = 2,
     StartTime = DateTime.Today.AddDays(1).Date.AddHours(11),
     EndTime = DateTime.Today.AddDays(1).Date.AddHours(13),
     Subject = "Scrum meeting - Changed",
     RecurrenceId=1,
});

//Adding the scheduler appointment collection to the AppointmentsSource of .NET MAUI Scheduler.
scheduler.AppointmentsSource = appointment;
this.Content = scheduler;
Modified an occurrence of a recurring appointment on a Scheduler
Modified an occurrence of a recurring appointment on a Scheduler

Conclusion

Thank you for your time! This blog post showed how to set a recurring appointment in the .NET MAUI Scheduler. You can explore other features in the Scheduler control in the documentation, where you can find detailed explanations of each with code examples.

If you are not a Syncfusion customer, you can try our 30-day free trial to see how our components can enhance your projects.

Please feel free to try out the samples available in our .NET MAUI sample location and share your feedback or ask questions in the comments section. Or contact us through our support forum, support portal, or feedback portal. We are happy to assist you!

Related blogs

Tags:

Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed
Scroll To Top