FirstDayOfWeek is not linked with Locale

Hi,

When using the DateTimePicker control, I can set the Locale of the control, but this does use the FirstDayOfWeek value of the Locale.

Please find the code below :

--------

@using Syncfusion.Blazor.Calendars

<div class="control-section">
    <div class="control_wrapper">
        <div>Locale: @(System.Globalization.CultureInfo.CurrentUICulture.ToString())</div>
        <div>First day of week: @(System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat.FirstDayOfWeek)</div>

        <SfDatePicker TValue="DateTime"
                      Value="@CurrentValue"
                      CssClass="@CssClassCorrected"
                      Locale="@System.Globalization.CultureInfo.CurrentUICulture.ToString()" />
    </div>
</div>

@code{
    private DateTime CurrentValue = DateTime.Today;
    private string CssClassCorrected = "";

    protected override void OnInitialized()
    {
        base.OnInitialized();

        System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.GetCultureInfo("nl-BE");
    }
}

--------

Output:


For the Dutch locale, the first day of the week is Monday, but it is displaying Sunday (Zo) as the first day.


Best regards,

Mike

1 Reply 1 reply marked as answer

BC Berly Christopher Syncfusion Team November 16, 2020 11:46 AM UTC

Hi Michael, 
  
Greetings from Syncfusion support. 
  
We would like to inform you that, when we render the DatePicker component with culture settings, then the component will be displayed the first day of week based on the en-US culture. So, we suggest you to modify the first day of week based on the culture with help of FirstDayOfWeek property.  
  
<SfDatePicker TValue="DateTime?" Locale="nl-BE" FirstDayOfWeek="1"></SfDatePicker> 

  
  
  
Regards, 
Berly B.C 


Marked as answer
Loader.
Up arrow icon