How to localize Blazor DateRangePicker?

Answer:

We can localize Blazor DateRangePicker using below code snippet.

@using Syncfusion.Blazor.Calendars

<SfDateRangePicker>SfDateRangePicker>

@code {

[Inject]

protected IJSRuntime JsRuntime { get; set; }

protected override void OnAfterRender(bool firstRender)

{

this.JsRuntime.Sf().LoadLocaleData("wwwroot/ej2-locale/src/de.json").SetCulture("de").LoadCldrData(new string[] { "wwwroot/cldr-data/main/de/ca-gregorian.json", "wwwroot/cldr-data/main/de/timeZoneNames.json", "wwwroot/cldr-data/main/de/numbers.json" });

}

}


Find the sample for localize Blazor DateRangePicker from here.


2 Replies

GI gisela April 26, 2026 03:28 PM UTC

Hi Syncfusion Team,


the above sample i have changed to

        this.JsRuntime.Sf().LoadLocaleData("wwwroot/ej2-locale/src/de.json").SetCulture("de");

        this.JsRuntime.Sf().LoadLocaleData("wwwroot/ej2-locale/src/de.json").SetCulture("de").LoadCldrData(new string[] { "wwwroot/cldr-data/main/de/ca-gregorian.json", "wwwroot/cldr-data/main/de/timeZoneNames.json", "wwwroot/cldr-data/main/de/numbers.json" });


In German, Monday is the first day of the week, but the DateRangePicker always shows Sunday as the first day.

How can I make the DateRangePicker show Monday as the first day of the week?

Thanks in advance







PK Priyanka Karthikeyan Syncfusion Team April 27, 2026 11:11 AM UTC

Hi gisela,

 

To configure the DateRangePicker to show Monday as the first day of the week in your German-localized Blazor application, you need explicitly specify the first day of the week. to set the FirstDayOfWeek property specifically. Even though you've set the culture to German using SetCulture("de"), you'll need to

 

You can set Monday as the first day of the week by adding the FirstDayOfWeek property with a value of 1:


@using Syncfusion.Blazor.Calendars

<SfDateRangePicker TValue="DateTime?" Placeholder="Select Range" FirstDayOfWeek=1></SfDateRangePicker>

The FirstDayOfWeek property allows you to customize the start day of the week regardless of culture settings. In this property:

  • 0 represents Sunday
  • 1 represents Monday
  • 2 represents Tuesday
  • And so on...

For German localization, setting FirstDayOfWeek=1 will ensure that Monday appears as the first day of the week in your DateRangePicker component, which aligns with German standards.

 

Regards,

Priyanka K


Loader.
Up arrow icon