Exploring the Calendar Types in WinUI Scheduler
Tags: winui, csharp, dotnet, desktop
Published: 2021-11-12 12:37:48

---
title: Exploring the Calendar Types in WinUI Scheduler
published: true
date: 2021-11-12 11:49:52 UTC
tags: winui, csharp, dotnet, desktop
canonical_url: https://www.syncfusion.com/blogs/post/exploring-the-calendar-types-in-winui-scheduler.aspx
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p5uhkf2l05pfvp8p0g85.png
---

Calendars vary from country to country. For example, a work schedule in California is different from one in India. So, a world-class scheduler should satisfy its users by letting them use regional calendars to schedule their appointments.

The Syncfusion [WinUI Scheduler](https://www.syncfusion.com/winui-controls/scheduler "Link to WinUI Scheduler") is used to schedule and manage appointments through an intuitive user interface, similar to the Windows Calendar. It supports the following calendar types:

- Gregorian
- Hebrew
- Hijri
- Korean
- Persian
- Taiwan
- Thai
- UmAlQura

**Note:** The default calendar type is Gregorian.

All these calendar types in the WinUI Scheduler support a complete set of scheduling functionalities, such as event management, minimum and maximum dates, the first day of the week customization, RTL, localization, and special date customization.

In this blog, we will explore the **Hijri** calendar and learn how to use the basic scheduling functionalities in it.

**Note:** If you are new to our Scheduler control, please read the [Getting started with the WinUI Scheduler documentation](https://help.syncfusion.com/winui/scheduler/getting-started "Documentation link to getting started with WinUI Scheduler") before proceeding.

## Hijri calendar

The [Islamic or Hijri calendar](https://en.wikipedia.org/wiki/Islamic_calendar "Link to the Wikipedia page for Islamic calendar") is a lunar calendar consisting of 12 months in a year with 354 or 355 days.

You can easily display the **Hijri** calendar in the WinUI Scheduler by using the [CalendarIdentifier](https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Scheduler.SfScheduler.html#Syncfusion_UI_Xaml_Scheduler_SfScheduler_CalendarIdentifier "Link to the CalendarIdentifier property of WinUI Scheduler") property.

Refer to the following code example.

```html
xmlns:scheduler="using:Syncfusion.UI.Xaml.Scheduler"

<scheduler:SfScheduler x:Name="scheduler" 
                       CalendarIdentifier="HijriCalendar" >
</scheduler:SfScheduler>
```

![Displaying the Hijri Calendar in the WinUI Scheduler](https://www.syncfusion.com/blogs/wp-content/uploads/2021/11/Displaying-the-Hijri-Calendar-in-the-WinUI-Scheduler.png)
<figcaption>Displaying the Hijri Calendar in the WinUI Scheduler</figcaption>

## Multiple scheduler views

The Scheduler dates are displayed based on the [calendar types](https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Scheduler.SfScheduler.html#Syncfusion_UI_Xaml_Scheduler_SfScheduler_CalendarIdentifier "Link to the CalendarIdentifier property of WinUI Scheduler") **.** The WinUI Scheduler supports eight [types of views](https://help.syncfusion.com/winui/scheduler/getting-started#change-different-scheduler-views "Documentation link to change different Scheduler Views") (day, week, workweek, month, timeline day, timeline week, timeline workweek, and timeline month) to display dates.

You can assign the required view by using the [ViewType](https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Scheduler.SfScheduler.html#Syncfusion_UI_Xaml_Scheduler_SfScheduler_ViewType "Link to the ViewType property of WinUI Scheduler") property like in the following code example.

```html
<scheduler:SfScheduler x:Name="scheduler" 
                       CalendarIdentifier="HijriCalendar"
                       ViewType="Week">
</scheduler:SfScheduler>
```

## First day of week

By default, the WinUI Scheduler will be rendered with **Sunday**  as the first day of the week. You can easily change it by using the [FirstDayOfWeek](https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Scheduler.SfScheduler.html#Syncfusion_UI_Xaml_Scheduler_SfScheduler_FirstDayOfWeek "Link to the FirstDayOfWeek property of WinUI Scheduler") property of the **Scheduler** based on the calendar type.

Refer to the following code example.

```html
<scheduler:SfScheduler x:Name="scheduler" 
                       FirstDayOfWeek="Thursday"
                       CalendarIdentifier="HijriCalendar"
                       ViewType="Week">
</scheduler:SfScheduler>
```

![Changing the First Day of Week in the WinUI Scheduler](https://www.syncfusion.com/blogs/wp-content/uploads/2021/11/Changing-the-First-Day-of-Week-in-the-WinUI-Scheduler.png)
<figcaption>Changing the First Day of Week in the WinUI Scheduler</figcaption>

## Appointments

You can easily [add appointments](https://help.syncfusion.com/winui/scheduler/appointments "Documentation link to Appointments in WinUI Scheduler") to the calendar in the WinUI Scheduler in either of two ways:

- Create an appointment with start-time and end-time values by declaring the **calendar type** and respective **calendar type date. ** Refer to the following code example.
```csharp
// Creating an instance for the schedule appointment collection.
var appointments = new ScheduleAppointmentCollection();
// Adding schedule appointment in the schedule appointment collection.
appointments.Add(new ScheduleAppointment()
{
   Subject = "Meeting",
   // StartTime and EndTime values specified with calendar type and calendar date.
   StartTime = new DateTime (1443, 02, 22, 10, 0, 0, new HijriCalendar()),
   EndTime = new DateTime(1443, 02, 22, 11, 0, 0, new HijriCalendar()),
});
// Adding the schedule appointment collection to the ItemsSource.

this.scheduler.ItemsSource = appointments;
```

- Create an appointment with start and end times by declaring the local system date. In this case, the system date will be converted to the relevant calendar type date. Refer to the following code example.
```csharp
// Creating an instance for the schedule appointment collection.
var appointments = new ScheduleAppointmentCollection();
// Adding schedule appointment in the schedule appointment collection.
appointments.Add(new ScheduleAppointment()
{
   Subject = "Meeting",
  // StartTime and EndTime values specified with local system date will be converted to the Hijiri calendar.
   StartTime = new DateTime(2021, 09, 29, 10, 0, 0, 0),
   EndTime = new DateTime(2021, 09, 29, 11, 0, 0, 0),
});
// Adding the schedule appointment collection to the ItemsSource.
this.scheduler.ItemsSource = appointments;
```

![Adding Appointments in WinUI Scheduler](https://www.syncfusion.com/blogs/wp-content/uploads/2021/11/Adding-Appointments-in-WinUI-Scheduler.png)
<figcaption>Adding Appointments in WinUI Scheduler</figcaption>

## Resource grouping

The WinUI Scheduler allows you to add [Resources](https://help.syncfusion.com/winui/scheduler/resource-grouping "Documentation link to Resource Grouping in WinUI Scheduler") to the calendar. You can group the resources by either resource or date using the [ResourceGroupType](https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Scheduler.ResourceGroupType.html "Link to the ResourceGroupType class of WinUI Scheduler") property based on the calendar type.

```csharp
// Adding schedule resource in the scheduler resource collection.
var ResourceCollection = new ObservableCollection<SchedulerResource>()
{
    new SchedulerResource() { Name = "Sophia", Foreground = new SolidColorBrush(Colors.White), Background = new SolidColorBrush((Color.FromArgb(255, 157, 101, 201))), Id = "1000" },
    new SchedulerResource() { Name = "Zoey Addison", Foreground = new SolidColorBrush(Colors.White), Background = new SolidColorBrush(Color.FromArgb(255, 240, 138, 93)), Id = "1001" },
   new SchedulerResource() { Name = "James William", Foreground = new SolidColorBrush(Colors.White), Background = new SolidColorBrush(Color.FromArgb(255,103, 155, 155)), Id = "1002" },
};

// Adding the scheduler resource collection to the schedule resources of SfScheduler.
this.scheduler.ResourceCollection = ResourceCollection;
```

![Resource Grouping in the WinUI Scheduler](https://www.syncfusion.com/blogs/wp-content/uploads/2021/11/Resource-Grouping-in-the-WinUI-Scheduler.png)
<figcaption>Resource Grouping in the WinUI Scheduler</figcaption>

### Assigning appointments to Scheduler resources

You can associate the resources with the appointments by assigning the  **Id**  property of the resources in the [ResourceIdCollection](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Scheduler.ScheduleAppointment.html#Syncfusion_UI_Xaml_Scheduler_ScheduleAppointment_ResourceIdCollection "Link to the ResourceIdCollection property of WinUI Scheduler") API of the [ScheduleAppointment](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Scheduler.ScheduleAppointment.html "Link to the ScheduleAppointment class of WinUI Scheduler") class.

```csharp
// Creating an instance for the schedule appointment collection.
var scheduleAppointmentCollection = new ScheduleAppointmentCollection();
//Adding schedule appointment in the schedule appointment collection.
var appointment = new ScheduleAppointment()
{
// StartTime and EndTime values specified with local system date will be converted to the Hijiri calendar.
    StartTime = new DateTime(2021, 09, 29, 10, 0, 0),
    EndTime = new DateTime(2021, 09, 29, 11, 0, 0),
    Subject = "General Meeting",
    //Add Scheduler Resource Id to the schedule appointment.
   ResourceIdCollection = new ObservableCollection<object>() { "1000", "1001" }
};
//Adding the schedule appointment to the schedule appointment collection.
scheduleAppointmentCollection.Add(appointment);
//Adding the schedule appointment collection to the ItemsSource of SfScheduler.
this.scheduler.ItemsSource = scheduleAppointmentCollection;
```

![Assigning Resources to Appointments in WinUI Scheduler](https://www.syncfusion.com/blogs/wp-content/uploads/2021/11/Assigning-Resources-to-Appointments-in-WinUI-Scheduler.png)
<figcaption>Assigning Resources to Appointments in WinUI Scheduler</figcaption>

## Range for visible dates

You can keep your users from selecting dates outside a specified time range and prevent navigation beyond the [ minimum](https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Scheduler.SfScheduler.html#Syncfusion_UI_Xaml_Scheduler_SfScheduler_MinimumDate "Link to the MinimumDate property of WinUI Scheduler")and [maximum dates](https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Scheduler.SfScheduler.html#Syncfusion_UI_Xaml_Scheduler_SfScheduler_MaximumDate "Link to the MaximumDate property of WinUI Scheduler"). There are two ways:

- Set the Scheduler minimum and maximum date values by declaring the **calendar type** and  **calendar type date**.
```csharp
// DateTime value specified with calendar type and calendar date.
this.scheduler.MinimumDate = new DateTime(1443, 02, 22, 10, 0, 0, new HijriCalendar());
this.scheduler.MaximumDate = new DateTime(1443, 05, 22, 11, 0, 0, new HijriCalendar());
```

- Set the Scheduler minimum and maximum dates by declaring a local system date. In this case, the system date will be converted to the relevant calendar type date.
```csharp
// DateTime value specified with local system date will be converted to the Hijiri calendar.
this.scheduler.MinimumDate = new DateTime(2021, 02, 22, 10, 0, 0);
this.scheduler.MaximumDate = new DateTime(2021, 05, 22, 11, 0, 0);
```

## Programmatic date navigation

Using the [DisplayDate](https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Scheduler.SfScheduler.html#Syncfusion_UI_Xaml_Scheduler_SfScheduler_DisplayDate "Link to the DisplayDate property of WinUI Scheduler") property, you can programmatically navigate the dates for the supported calendar types. There are two ways:

- Set the Scheduler display date value by declaring the **calendar type** and **calendar type date**.
```csharp
// DateTime value specified with calendar type and calendar date.
this.scheduler.DisplayDate= new DateTime(1443, 02, 22, 10, 0, 0, new HijriCalendar());
```

- Set the Scheduler display date value by declaring a local system date. Here, the system date will be converted to the relevant calendar type date.
```
// DateTime value specified with local system date will be converted to the Hijiri calendar.
this.scheduler.DisplayDate= new DateTime(2021, 09, 29, 10, 0, 0);
```

![Date Navigation in WinUI Scheduler](https://www.syncfusion.com/blogs/wp-content/uploads/2021/11/Date-Navigation-in-WinUI-Scheduler.png)
<figcaption>Date Navigation in WinUI Scheduler</figcaption>

## Programmatic date selection

Use the [SelectedDate](https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Scheduler.SfScheduler.html#Syncfusion_UI_Xaml_Scheduler_SfScheduler_SelectedDate "Link to the SelectedDate property of WinUI Scheduler") property to programmatically select the dates for the calendar. Use either of these ways:

- Set the Scheduler selected date value by declaring the **calendar type** and  **calendar type date**.
```csharp
// DateTime value specified with calendar type and calendar date.
this.scheduler.SelectedDate = new DateTime(1443, 02, 22, 10, 0, 0, new HijriCalendar());
```

- Set the Scheduler display date value by declaring a local system date. Here, the system date will be converted to the relevant calendar type date.
```csharp
// DateTime value specified with local system date will be converted to the Hijiri calendar.
this.scheduler.SelectedDate = new DateTime(2021, 09, 29, 10, 0, 0);
```

![Selecting Date in WinUI Scheduler](https://www.syncfusion.com/blogs/wp-content/uploads/2021/11/Date-selection-in-WinUI-Scheduler.png)
<figcaption>Selecting Date in WinUI Scheduler</figcaption>

## Highlight time region

You can highlight a special time region in [days](https://help.syncfusion.com/winui/scheduler/day-week-views#special-time-regions "Documentation link to Special time region in Day Views of WinUI Scheduler") and [timeline](https://help.syncfusion.com/winui/scheduler/timeline-views#special-time-regions "Documentation link to Special time region in Timeline Views of WinUI Scheduler") views in all the supported calendar types. To do so, please take either of these steps:

- Create a special time region with start and end time values by declaring the **calendar type** and  **calendar type date**.
```csharp
this.scheduler.DaysViewSettings.SpecialTimeRegions.Add(new SpecialTimeRegion
{
   // StartTime and EndTime value specified with calendar type and calendar date.
   StartTime = new DateTime(1443, 02, 22, 10, 0, 0, new HijriCalendar()),
   EndTime = new DateTime(1443, 02, 22, 11, 0, 0, new HijriCalendar()),
   CanEdit = true,
   Background = new SolidColorBrush(Colors.LightGray),
   Foreground = new SolidColorBrush(Colors.White),
});
```

- Create the special time region with start and end time values by declaring a local system date. Here, the system date will be converted to the relevant calendar type date.
```csharp
this.scheduler.DaysViewSettings.SpecialTimeRegions.Add(new SpecialTimeRegion
{
 // StartTime and EndTime value specified with local system date will be converted to the Hijiri calendar.
    StartTime = new System.DateTime(2021, 09, 29, 13, 0, 0),
    EndTime = new System.DateTime(2021, 09, 29, 14, 0, 0),
    CanEdit = false,
    Background = new SolidColorBrush(Colors.LightGray),
    Foreground = new SolidColorBrush(Colors.White),
});
```

![Highlighting a Special Time Region in WinUI Scheduler](https://www.syncfusion.com/blogs/wp-content/uploads/2021/11/Highlighting-Special-Time-Region-in-WinUI-Scheduler.png)
<figcaption>Highlighting a Special Time Region in WinUI Scheduler</figcaption>

## Highlight blackout date

Also, you can highlight a [blackout day](https://help.syncfusion.com/winui/scheduler/month-view#blackout-dates "Documentation link to blackout dates in WinUI Scheduler") in month view in the calendar. You can allocate or restrict specific dates for the predefined events. Use either of these ways:

- Add a blackout date value by declaring the calendar type and calendar type date.
```csharp
this.scheduler.BlackoutDates = GetBlackoutDates();

/// <summary>
/// Method to get blackout date collections.
/// </summary>
// <returns>The blackoutDateCollection.</returns>
private ObservableCollection<DateTime> GetBlackoutDates()
{
    var blackoutDateCollection = new ObservableCollection<DateTime>()
    {
       // DateTime value specified with calendar type and calendar date.
        new DateTime(1443, 02, 20, 10, 0, 0, new HijriCalendar()),
        new DateTime(1443, 02, 21, 10, 0, 0, new HijriCalendar()),
        new DateTime(1443, 02, 22, 10, 0, 0, new HijriCalendar()),
        new DateTime(1443, 02, 23, 10, 0, 0, new HijriCalendar()),
        new DateTime(1443, 02, 24, 10, 0, 0, new HijriCalendar()),
     };
    return blackoutDateCollection;
}
```

- Add the blackout date value by declaring a local system date. The system date will be converted to the relevant calendar type date.
```csharp
this.scheduler.BlackoutDates = GetBlackoutDates();

/// <summary>
/// Method to get blackout date collections.
/// </summary>
// <returns>The blackoutDateCollection.</returns>
private ObservableCollection<DateTime> GetBlackoutDates()
{
    var blackoutDateCollection = new ObservableCollection<DateTime>()
    {
// DateTime value specified with local system date will be converted to the Hijiri calendar.
        new DateTime(2021, 09, 27, 10, 0, 0),
        new DateTime(2021, 09, 28, 10, 0, 0),
        new DateTime(2021, 09, 29, 10, 0, 0),
        new DateTime(2021, 09, 30, 10, 0, 0),
    };
      return blackoutDateCollection;
}
```

![Highlighting Blackout Dates in WinUI Scheduler](https://www.syncfusion.com/blogs/wp-content/uploads/2021/11/Highlighting-Blackout-Dates-in-WinUI-Scheduler.png)
<figcaption>Highlighting Blackout Dates in WinUI Scheduler</figcaption>

## Flow direction

The WinUI Scheduler flow direction automatically switches to **RightToLeft** for the following calendar types:

- Hebrew
- Hijri
- UmAlQura
- Persian

## Localization

You can localize the Scheduler based on the language using the [Language](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.frameworkelement.language?view=winrt-20348#Windows_UI_Xaml_FrameworkElement_Language "Link to the FrameworkElement.Language Property of WinUI") property. The default value of the Language property is  **en-US.****  **

Also, you can localize the custom string (for example: Today and Appointment editor window details) in the Scheduler by adding the [resource files for the required language](https://help.syncfusion.com/winui/localization "Documentation link to Localization of Syncfusion WinUI controls").

In the following example, we have set the Language property value as  **ar** , which represents the Arabic language.

```html
<scheduler:SfScheduler x:Name="scheduler" 
                       Language="ar"
                       CalendarIdentifier="HijriCalendar"
                       ViewType="Week">
</scheduler:SfScheduler>
```

**Note:** For more details, refer to the [Calendar Types in WinUI Scheduler demo on GitHub](https://github.com/SyncfusionExamples/WinUI-Scheduler-Examples/tree/main/CalendarTypes "Link to Calendar types in WinUI Scheduler demo on GitHub").

## Conclusion

Thanks for reading! In this blog post, we did a quick overview of the calendar types in the [WinUI Scheduler](https://www.syncfusion.com/winui-controls/scheduler "Link to WinUI Scheduler") and other basic scheduling functionalities. With these features, you can easily reach your global audience by helping them schedule appointments in their local calendars.

Also, read our [WinUI Scheduler documentation](https://help.syncfusion.com/winui/scheduler/overview "Documentation link to WinUI Scheduler"), where you can find detailed explanations of all Scheduler’s other features with code examples. Feel free to try out the [WinUI demos on GitHub](https://github.com/SyncfusionExamples/WinUI-Scheduler-Examples "Link to the WinUI Scheduler demos on GitHub") and share your feedback or ask questions in the comments section.

If you aren’t a customer yet, you can try our 30-day [free trial](https://www.syncfusion.com/downloads "Link to the free evaluation of the Syncfusion Essential Studio") to check out these features.

You can contact us through our [support forum](https://www.syncfusion.com/forums "Link to the Syncfusion support forum"), [Direct-Trac](https://www.syncfusion.com/support/directtrac/incidents "Link to the Syncfusion support system Direct Trac"), or [feedback portal](https://www.syncfusion.com/feedback/home "Link to Syncfusion Feedback Portal"). We are happy to assist you!

## Related blogs

- [WinUI Scheduler: A Smart Tool to Handle Appointments in a Hospital](https://dev.to/karthickramasamy08/winui-scheduler-a-smart-tool-to-handle-appointments-in-a-hospital-90a-temp-slug-2163934 "Link to WinUI Scheduler: A Smart Tool to Handle Appointments in a Hospital blog")
- [Everything You Need to Know About WinUI Badge Control](https://dev.to/karthickramasamy08/everything-you-need-to-know-about-winui-badge-control-3719-temp-slug-3991591 "Link to Everything You Need to Know About The WinUI Badge Control blog")
- [Introducing Syncfusion Ribbon for WinUI](https://dev.to/syncfusion/introducing-syncfusion-ribbon-for-winui-4blc "Link to Introducing Syncfusion Ribbon for WinUI blog")
- [New WinUI Segmented Control Is Here!](https://dev.to/kartik110895/new-winui-segmented-control-is-here-38i-temp-slug-3162889 "Link to New WinUI Segmented Control Is Here! blog")