Mastering Globalization: Utilizing Calendar Types in .NET MAUI Calendar Control
Tags: dotnetmaui, development, mobile, desktop
Published: 2023-09-11 04:48:17

---
title: Mastering Globalization: Utilizing Calendar Types in .NET MAUI Calendar Control
published: true
date: 2023-09-08 11:24:41 UTC
tags: dotnetmaui, development, mobile, desktop
canonical_url: https://www.syncfusion.com/blogs/post/globalization-in-dotnet-maui-calendar.aspx
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2y2iqj3ucj82jxp2ztnn.png
---
Different regions and cultures follow distinct calendar systems, reflecting their unique traditions and historical context. These calendar systems often vary in month lengths, year starts, and year ends. In today’s globalized world, developing applications that cater to users from diverse cultures and regions is essential.

The Syncfusion [.NET MAUI Calendar](https://www.syncfusion.com/maui-controls/maui-calendar ".NET MAUI Calendar") control provides different calendar types, enabling developers to cater to a broader user base and users to interact with dates according to their cultural or regional preferences.

In this blog, we’ll explore the different calendar types and their basic functionalities in the .NET MAUI Calendar control.

**Note:** If you are new to this control, refer to the [.NET MAUI Calendar getting started](https://help.syncfusion.com/maui/calendar/getting-started "Getting started with .NET MAUI Calendar") documentation for background knowledge.

## Different calendar types

The .NET MAUI Calendar supports different calendar types and displays dates, months, and years based on the one specified. Gregorian is the default calendar type.
<table>
<tbody>
<tr>
<td width="120">
<p><strong>Types</strong></p>
</td>
<td width="504">
<p><strong>Description</strong></p>
</td>
</tr>
<tr>
<td width="120">
<p>Gregorian</p>
</td>
<td width="504">
<p>This type of calendar is the most widely used civil calendar worldwide. The minimum supported date value is 01/01/01, and the maximum supported date value is 31/12/9999. The current year of the Gregorian calendar is 2023.</p>
</td>
</tr>
<tr>
<td width="120">
<p>Hijri</p>
</td>
<td width="504">
<p>This calendar type is mostly used in <strong>Saudi</strong> <strong>Arabia</strong> and the <strong>United Arab Emirates</strong>. The minimum supported date value is 01/01/01 (in Gregorian 18/07/622), and the maximum supported date value is 03/04/9666 (in Gregorian 31/12/9999). The current year of the Hijri calendar is 1444.</p>
</td>
</tr>
<tr>
<td width="120">
<p>Korean</p>
</td>
<td width="504">
<p>This type of calendar is very much like the Gregorian calendar and it only supports the current era. The minimum supported date value is 01/01/2334 (in Gregorian 01/01/01), and the maximum supported date value is 31/12/9999 (in Gregorian 31/12/12332). The current year of the Korean calendar is 4356.</p>
</td>
</tr>
<tr>
<td width="120">
<p>Persian</p>
</td>
<td width="504">
<p>This type of calendar is mostly used in <strong>Iran</strong>. The minimum supported date value is 01/01/01 (in Gregorian 21/03/622), and the maximum supported date value is 13/10/9378 (in Gregorian 31/12/9999). The current year of the Persian calendar is 1402.</p>
</td>
</tr>
<tr>
<td width="120">
<p>Taiwan</p>
</td>
<td width="504">
<p>This type of calendar, too, is like the Gregorian calendar and only supports the current era. The minimum supported date value is 01/01/01 (in Gregorian 01/01/1912), and the maximum supported date value is 31/12/8088 (in Gregorian 31/12/9999). The current year of the Taiwan calendar is 112.</p>
</td>
</tr>
<tr>
<td width="120">
<p>Thai</p>
</td>
<td width="504">
<p>This type of calendar is exactly like the Gregorian calendar and only supports the current era. The minimum supported date value is 01/01/544 (in Gregorian 01/01/01), and the maximum supported date value is 31/12/10542 (in Gregorian 31/12/9999). The current year of the Thai calendar is 2566.</p>
</td>
</tr>
<tr>
<td width="120">
<p>UmAlQura</p>
</td>
<td width="504">
<p>This type of calendar represents the <strong>Saudi Hijri calendar</strong> and is nearly identical to the <strong>Hijri </strong>calendar. The minimum supported date value is 01/01/1318 (in Gregorian 30/04/1900), and the maximum supported date value is 29/12/1450 (in Gregorian 13/05/2029). The current year of the  UmAlQura calendar is 1444.</p>
</td>
</tr>
</tbody>
</table>
You can easily change the calendar type using the [Identifier](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Calendar.SfCalendar.html#Syncfusion_Maui_Calendar_SfCalendar_Identifier "Identifier Property of .NET MAUI Calendar Control") property in the [SfCalendar](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Calendar.SfCalendar.html "SfCalendar Class of .NET MAUI Calendar Control"). Refer to the following code example.

```xml
<calendar:SfCalendar x:Name="Calendar" Identifier="Hijri"> 
</Calendar:SfCalendar>
```
<figure>

  <img src="https://www.syncfusion.com/blogs/wp-content/uploads/2023/09/Hijri-calendar-type-in-.NET-MAUI-Calendar.png" alt="Hijri calendar type in .NET MAUI Calendar" style="width:100%">

  <figcaption>Hijri calendar type in .NET MAUI Calendar</figcaption>

</figure>

## Different calendar views

The .NET MAUI Calendar control enriches the experience of using different calendar types by incorporating various calendar views, including month, year, decade, and century views. These distinct views offer versatile options for interacting with dates, months, and years based on the specified calendar type.
<table>
<tbody>
<tr style="background: none;">
<td style="width: 50%; border: none !important;"><img src="https://www.syncfusion.com/blogs/wp-content/uploads/2023/09/Hijri-Month-view-in-.NET-MAUI-Calendar-1.png" alt="Hijri Month view in .NET MAUI Calendar" width="379" height="458" class="aligncenter wp-image-122113 size-full" /></td>
<td style="width: 50%; border: none !important;"><img src="https://www.syncfusion.com/blogs/wp-content/uploads/2023/09/Hijri-Year-view-in-.NET-MAUI-Calendar.png" alt="Hijri Year view in .NET MAUI Calendar" width="379" height="458" class="aligncenter size-full wp-image-122109" /></td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr style="background: none;">
<td style="width: 50%; border: none !important;"><img src="https://www.syncfusion.com/blogs/wp-content/uploads/2023/09/Hijri-Decade-view-in-.NET-MAUI-Calendar.png" alt="Hijri Decade view in .NET MAUI Calendar" width="314" height="380" class="aligncenter size-full wp-image-122110" /></td>
<td style="width: 50%; border: none !important;"><img src="https://www.syncfusion.com/blogs/wp-content/uploads/2023/09/Hijri-Century-view-in-.NET-MAUI-Calendar.png" alt="Hijri Century view in .NET MAUI Calendar" width="314" height="380" class="aligncenter size-full wp-image-122111" /></td>
</tr>
</tbody>
</table>
<figcaption>Different calendar views in .NET MAUI Calendar control</figcaption>
You can change the calendar view using the [View](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Calendar.SfCalendar.html#Syncfusion_Maui_Calendar_SfCalendar_View "View Property of .NET MAUI Calendar Control") property in the [SfCalendar](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Calendar.SfCalendar.html "SfCalendar Class Property of .NET MAUI Calendar Control"). Refer to the following code example.

```xml
<calendar:SfCalendar x:Name="Calendar" Identifier="Hijri" View="Month"> 
</Calendar:SfCalendar>
```

## Specifying the date value

When working with different calendar types in the .NET MAUI Calendar, you can assign a date value to its properties in two ways.

### Generating a date

You can create a date value by declaring the calendar type while creating the date instance.

Refer to the following code example. Here, we’ve declared the date by specifying the calendar type as Hijri.

```csharp
SfCalendar calendar = new SfCalendar();
Calendar hijriCalendar = new HijriCalendar();
DateTime date = new DateTime(1444, 12, 6, hijriCalendar);
calendar.SelectedDate = date;
```

### Generating a date without calendar type

You can also create a date value without explicitly specifying the calendar type. In this case, the .NET MAUI Calendar will automatically convert and interpret the date value based on the specified local system’s calendar type.

Refer to the following code example. Here, we’ve used the Gregorian date, but the .NET MAUI Calendar control converts it to the corresponding Hijri calendar date.

```csharp
SfCalendar calendar = new SfCalendar();
DateTime date = new DateTime(2023, 6, 24);
calendar.SelectedDate = date;
```
<figure>

  <img src="https://www.syncfusion.com/blogs/wp-content/uploads/2023/09/Hijri-Month-view-in-.NET-MAUI-Calendar-1.png" alt="Specifying the date value in .NET MAUI Calendar" style="width:100%">

  <figcaption>Specifying the date value in .NET MAUI Calendar</figcaption>

</figure>

## Specifying the flow direction

The .NET MAUI Calendar control automatically adjusts the flow direction based on the specified calendar type. This means that when you choose a calendar type with a right-to-left flow direction, such as in the Arabic calendar, the .NET MAUI Calendar control will automatically display the calendar elements in a right-to-left orientation.

The right-to-left supported calendar types in the .NET MAUI Calendar are:

- Hijri
- Persian
- UmAlQura

## Conclusion

Thanks for reading! In this blog, we have explored the various calendar types available in the Syncfusion [.NET MAUI Calendar](https://www.syncfusion.com/maui-controls/maui-calendar ".NET MAUI Calendar") control and their versatile features. With this, you can enhance the experience of your global users.

Explore other features in the Calendar control in its [documentation](https://help.syncfusion.com/maui/calendar/overview "Getting Started with the Overview of .NET MAUI Calendar"). Try out the .NET MAUI demos available on [GitHub](https://github.com/syncfusion/maui-demos "Syncfusion .NET MAUI GitHub demos") and share your feedback or ask questions in the comments section.

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

You can also 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 always happy to assist you!

## Related Blogs

- [Chart of the Week: Creating a .NET MAUI Horizontal Bar Chart to Compare Grocery Prices Between Two Countries](https://www.syncfusion.com/blogs/post/dotnet-maui-horizontal-bar-chart-compare-grocery-prices.aspx "Blog: Chart of the Week: Creating a .NET MAUI Horizontal Bar Chart to Compare Grocery Prices Between Two Countries")
- [Replicating a Storage UI in a .NET MAUI App](https://www.syncfusion.com/blogs/post/storage-ui-in-dotnet-maui.aspx "Blog: Replicating a Storage UI in a .NET MAUI App")
- [Easily Build ChatGPT-like App in .NET MAUI using OpenAI APIs](https://www.syncfusion.com/blogs/post/dotnet-maui-chatgpt-like-app-using-openai.aspx "Blog: Easily Build ChatGPT-like App in .NET MAUI using OpenAI APIs")
- [Load Custom Badge UI in Your .NET MAUI App: An Overview](https://www.syncfusion.com/blogs/post/load-custom-badge-ui-dotnet-maui.aspx "Blog: Load Custom Badge UI in Your .NET MAUI App: An Overview")