Time Regions in .NET MAUI Scheduler—An Overview
Tags: dotnetmaui, development, mobile, scheduler
Published: 2023-06-02 07:12:51

---
title: Time Regions in .NET MAUI Scheduler—An Overview
published: true
date: 2023-06-01 11:00:00 UTC
tags: dotnetmaui, development, mobile, scheduler
canonical_url: https://www.syncfusion.com/blogs/post/time-regions-dotnet-maui-scheduler.aspx
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/63dsoe2wxvwwyenp1dky.png
---
Time regions are specific units of time used to define periods or durations. The [.NET MAUI Scheduler](https://www.syncfusion.com/maui-controls/maui-scheduler ".NET MAUI Scheduler") supports customizing time regions. This customization includes adjusting the duration of time regions, setting specific start and end times, handling interactions in time regions, and defining recurring time regions.

By having their time regions customized, schedulers become more efficient and tailored to individual needs. For instance, in a doctor’s scheduling application, time regions can be customized to account for lunch and break times, which can prevent appointment scheduling during those times. This customization is essential to ensure there are no conflicts between appointments and that sufficient time is allocated for rest and meals.
<figure>

  <img src="https://www.syncfusion.com/blogs/wp-content/uploads/2023/05/Time-regions-in-.NET-MAUI-Scheduler-1.png" alt="Time regions in .NET MAUI Scheduler" style="width:100%">

  <figcaption>Time regions in .NET MAUI Scheduler</figcaption>

</figure>
**Note:** If you are new to this control, refer to the [.NET MAUI Scheduler getting started](https://help.syncfusion.com/maui/scheduler/getting-started "Getting started with .NET MAUI Scheduler") documentation before proceeding.

This blog will show you how to create and customize time regions in the .NET MAUI Scheduler control.

## Defining the time region

Defining the time region requires the essential details in the following table.
<table>
<tbody>
<tr>
<td width="180">
<p><strong>Customization options</strong></p>
</td>
<td width="444">
<p><strong>Summary</strong></p>
</td>
</tr>
<tr>
<td width="180">
<p><a title="StartTime property of .NET MAUI Scheduler" href="https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerRegionBase.html#Syncfusion_Maui_Scheduler_SchedulerRegionBase_StartTime">StartTime</a></p>
</td>
<td width="444">
<p>Customize the time region start date and time.</p>
</td>
</tr>
<tr>
<td width="180">
<p><a title="EndTime property of .NET MAUI Scheduler" href="https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerRegionBase.html#Syncfusion_Maui_Scheduler_SchedulerRegionBase_EndTime">EndTime</a></p>
</td>
<td width="444">
<p>Customize the time region end date and time.</p>
</td>
</tr>
<tr>
<td width="180">
<p><a title="Background property of .NET MAUI Scheduler" href="https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerRegionBase.html#Syncfusion_Maui_Scheduler_SchedulerRegionBase_Background">Background</a></p>
</td>
<td width="444">
<p>Customize the time region background color.</p>
</td>
</tr>
<tr>
<td width="180">
<p><a title="Text property of .NET MAUI Scheduler" href="https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerTimeRegion.html#Syncfusion_Maui_Scheduler_SchedulerTimeRegion_Text">Text</a></p>
</td>
<td width="444">
<p>Customize the text rendered in the time region.</p>
</td>
</tr>
<tr>
<td width="180">
<p><a title="TextStyle property of .NET MAUI Scheduler" href="https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerTimeRegion.html#Syncfusion_Maui_Scheduler_SchedulerTimeRegion_TextStyle">TextStyle</a></p>
</td>
<td width="444">
<p>Customize the style for the time region text.</p>
</td>
</tr>
</tbody>
</table>
## Interaction restriction on a time region

In the .NET MAUI Scheduler, the [SchedulerTimeRegion](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerTimeRegion.html "SchedulerTimeRegion class of .NET MAUI Scheduler") class supports controlling, enabling, or disabling touch interaction for a time region using the [EnablePointerInteraction](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerTimeRegion.html#Syncfusion_Maui_Scheduler_SchedulerTimeRegion_EnablePointerInteraction "EnablePointerInteraction property of .NET MAUI Scheduler") property. It prevents touch interaction on disabled time slots.

## Time region globalization

The time region feature provides globalization support, enabling users to customize time regions to align with different time zones or regional conventions using the [TimeZone](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerTimeRegion.html#Syncfusion_Maui_Scheduler_SchedulerTimeRegion_TimeZone "TimeZone property of .NET MAUI Scheduler") property. This can reduce errors when working across different time zones.

## Recurring time region

The time region feature provides recurrence support to repeat the same time region on a regular or periodic interval using [RecurrenceRule](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerRegionBase.html#Syncfusion_Maui_Scheduler_SchedulerRegionBase_RecurrenceRule "RecurrenceRule property of .NET MAUI Scheduler"). For example, you can schedule a daily lunch break for a doctor’s appointment scheduling system.

For more details about the recurrence rule, refer to the [recurrence rule](https://help.syncfusion.com/maui/scheduler/appointments#recurrence-rule "Recurrence Rule in .NET MAUI Scheduler") documentation.

The recurring exception is an advanced feature of time region recurrence that allows the exclusion of specific occurrences of a recurring time region by using the [RecurrenceExceptionDates](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerRegionBase.html#Syncfusion_Maui_Scheduler_SchedulerRegionBase_RecurrenceExceptionDates "RecurrenceExceptionDates property of .NET MAUI Scheduler") property in the **SchedulerTimeRegion** class. This feature is useful when a regular schedule needs to be altered on a particular day or for a particular period, such as holidays or planned maintenance.

## Resource-based time region

The time region feature provides resource support to create customized time slots based on specific resources or assets using the [ResourceIds](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerRegionBase.html#Syncfusion_Maui_Scheduler_SchedulerRegionBase_ResourceIds "ResourceIds property of .NET MAUI Scheduler") property. A resource-based time region defines the availability of those resources for scheduling.

## Applying the time regions to .NET MAUI Scheduler

The .NET MAUI Scheduler uses the **TimeRegions** property in the [SchedulerTimeSlotView](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Scheduler.SchedulerTimeSlotView.html "SchedulerTimeSlotView class of .NET MAUI Scheduler") class to customize the timeslots based on specified time regions and their properties such as **StartTime** , **EndTime** , **Text** , **Background** , and **TimeZone**.

```csharp
SfScheduler scheduler = new SfScheduler();
scheduler.View = SchedulerView.Week;
ObservableCollection<SchedulerTimeRegion> timeRegions = new ObservableCollection<SchedulerTimeRegion>();

//// Adding time region in the scheduler time region collection.
timeRegions.Add(new SchedulerTimeRegion()
{
        StartTime = DateTime.Today.Date.AddHours(13),
        EndTime = DateTime.Today.Date.AddHours(14),
        Text = "Lunch",
        EnablePointerInteraction = false,
        RecurrenceRule = "FREQ=DAILY;INTERVAL=1",
});

//// Assigning the scheduler time region collection to the TimeRegions in DayView of .NET MAUI Scheduler.
scheduler.DaysView.TimeRegions = timeRegions;
this.Content = scheduler;
```
<figure>

  <img src="https://www.syncfusion.com/blogs/wp-content/uploads/2023/05/Daily-recurrence-time-region-in-.NET-MAUI-Scheduler-1.png" alt="Daily recurrence time region in .NET MAUI Scheduler" style="width:100%">

  <figcaption>Daily recurrence time region in .NET MAUI Scheduler</figcaption>

</figure>
## Conclusion

Thank you for your time! This blog post showed you how to create and set a time region in the [.NET MAUI Scheduler](https://www.syncfusion.com/maui-controls/maui-scheduler ".NET MAUI Scheduler"). You can explore other features in the Scheduler control in its [documentation](https://help.syncfusion.com/maui/scheduler/overview "Overview of .NET MAUI Scheduler").

If you are not a Syncfusion customer, try our 30-day [free trial](https://www.syncfusion.com/downloads "Free evaluation of the Essential Studio products") to see how our components can enhance your projects.

Please try the samples available in our [.NET MAUI sample location](https://github.com/syncfusion/maui-demos ".NET MAUI controls GitHub demos") and share your feedback or ask questions in the comments section. Or contact us through our [support forum](https://www.syncfusion.com/forums "Syncfusion Support Forum"), [support portal](https://support.syncfusion.com/ "Syncfusion Support Portal"), or [feedback portal](https://www.syncfusion.com/feedback/home "Syncfusion Feedback Portal"). We are happy to assist you!

## Related blogs

- [Elevate Your App’s User Experience with the New .NET MAUI Shimmer Control](https://www.syncfusion.com/blogs/post/dotnet-maui-shimmer-control.aspx "Blog: Elevate Your App’s User Experience with the New .NET MAUI Shimmer Control")
- [Introducing the New .NET MAUI Popup Control](https://www.syncfusion.com/blogs/post/dotnet-maui-popup-control.aspx "Blog: Introducing the New .NET MAUI Popup Control")
- [Introducing the New .NET MAUI Masked Entry Control](https://www.syncfusion.com/blogs/post/dotnet-maui-masked-entry-control.aspx "Blog: Introducing the New .NET MAUI Masked Entry Control")
- [Streamline MAUI Projects with the Syncfusion .NET MAUI Template Studio](https://www.syncfusion.com/blogs/post/dotnet-maui-template-studio.aspx "Blog: Streamline MAUI Projects with the Syncfusion .NET MAUI Template Studio")