Recurring Events in .NET MAUI Scheduler—An Overview | Syncfusion Blogs
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (174).NET Core  (29).NET MAUI  (207)Angular  (109)ASP.NET  (51)ASP.NET Core  (82)ASP.NET MVC  (89)Azure  (41)Black Friday Deal  (1)Blazor  (215)BoldSign  (14)DocIO  (24)Essential JS 2  (107)Essential Studio  (200)File Formats  (66)Flutter  (133)JavaScript  (221)Microsoft  (119)PDF  (81)Python  (1)React  (100)Streamlit  (1)Succinctly series  (131)Syncfusion  (915)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (51)Windows Forms  (61)WinUI  (68)WPF  (159)Xamarin  (161)XlsIO  (36)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (147)Chart  (131)Cloud  (15)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (63)Development  (628)Doc  (8)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (40)Extensions  (22)File Manager  (7)Gantt  (18)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (507)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (43)Performance  (12)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (12)Scheduler  (52)Security  (3)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (31)Solution Services  (4)Spreadsheet  (11)SQL  (10)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (387)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (19)Web  (592)What's new  (332)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.

RuleDescription
FREQ=DAILY;INTERVAL=1;COUNT=5Repeats the appointment for 5 consecutive days.
FREQ=DAILY;INTERVAL=1;UNTIL=20221225Repeats the appointment every day until the specified end date.
FREQ=DAILY;INTERVAL=2Repeats 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.

RuleDescription
FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE;COUNT=5Repeats the appointment 5 times for specified weekdays (Monday, Wednesday) of every week.
FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE;UNTIL=20221225Repeats the appointment on specified weekdays (Monday, Wednesday) of every week until the specified end date.
FREQ=WEEKLY;INTERVAL=2;BYDAY=MO,WERepeats 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.

RuleDescription
FREQ=MONTHLY;BYMONTHDAY=3;INTERVAL=1;COUNT=5Repeats the appointment 5 times on a specified day (3rd) of every month.
FREQ=MONTHLY;INTERVAL=1;BYDAY=MO;BYSETPOS=2;UNTIL=20221225Repeats 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=2Repeats 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.

RuleDescription
FREQ=YEARLY;BYMONTHDAY=16;BYMONTH=6;INTERVAL=1;COUNT=5Repeats 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=20251225Repeats 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!

Test Flight
App Center Badge
Google Play Store Badge
Microsoft Badge
Github Store Badge

Related blogs

Tags:

Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed

Be the first to get updates

Subscribe RSS feed