Week Number in Blazor Calendar Component

1 Oct 20211 minute to read

You can enable WeekNumber in the Calendar by using the WeekNumber property.

@using Syncfusion.Blazor.Calendars

<SfCalendar TValue="DateTime?" WeekNumber=true></SfCalendar>

The output will be as follows.

Blazor Calendar displays Week Numbers

Week Rule

You can enable WeekRule in the Calendar by using the WeekRule property. This property provide an option to specify the rule for defining the first week of the year. Please find the possible values of WeekRule property.

Types Description
FirstDay Set the first week of the year’s week number to be started from 1. Then it followed as 1, 2, 3 …
FirstFullWeek Set the first week of the year’s week number to be started from 52 or 53 (i.e December last week’s week Number). Then it followed as 53, 1, 2 …
FirstFourDayWeek Set the week number based on the majority of dates present in the week for the respected months. If January dates are presented in the week more than December, the first week of the year’s week number will be started from 1. If December dates are presented in the week more than January, the first week of the year’s week number will be started from 52 or 53.

The output will be as follows.

Blazor Calendar displays Week Rule of FirstDay

Blazor Calendar displays Week Rule of FirstFullWeek

Blazor Calendar displays Week Rule of FirstFourDayWeek