Week Number in Blazor DateTimePicker Component

14 Nov 20221 minute to read

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

@using Syncfusion.Blazor.Calendars

<SfDateTimePicker TValue="DateTime?" Width="250px" WeekNumber="true"></SfDateTimePicker>

Blazor DateTimePicker with week numbers

Week Rule

You can enable WeekRule in the DateTimePicker by using the WeekRule property. This property provide an option to specify the rule for defining the first week of the year. 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.

Blazor DateTimePicker displays Week Rule of FirstDay

Blazor DateTimePicker displays Week Rule of FirstFullWeek

Blazor DateTimePicker displays Week Rule of FirstFourDayWeek