Articles in this section

How to change the rules for determining the first week of the year in WinUI calendar (SfCalendar)

In the WINUI calendar, you can change the first week of the year using the WeekNumberRule property. This rule has three types such as FirstDay, FirstFourDayWeek, and FirstFullWeek. You can use any for your requirement.

FirstDay- The first week of the year starts on the first day of the year.

FirstFourDayWeek-  The first week should have at least four days. 

FirstFullWeek- The first week should have all the seven days.

XAML

<Window
    x:Class="WeekNumberRule.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:WeekNumberRule"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:calendar="using:Syncfusion.UI.Xaml.Calendar">
 
    <calendar:SfCalendar x:Name="Calendar" HorizontalAlignment="Center" VerticalAlignment="Center"
                    ShowWeekNumbers="True" WeekNumberRule="FirstFullWeek"
                     />
</Window>

 

 

                 FirstDayWinUI calendar first day

 

           FirstFourDayWeek

WinUI calendar first four day week

 

               FirstFullWeek

WinUI calendar full week

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied