Globalization in Blazor Calendar Component

18 Jun 20261 minute to read

Blazor Calendar component can be localized. Refer to Blazor Localization topic to localize Blazor components.

Right-To-Left

The Calendar supports right-to-left (RTL) layout for languages like Arabic and Hebrew. RTL is not implied by Locale; explicitly set the EnableRtl property to true to render the component in RTL.

The following code example initializes the Calendar component in Arabic culture.

@using Syncfusion.Blazor.Calendars
@inject HttpClient Http;

<SfCalendar TValue="DateTime?" Locale="ar" EnableRtl=true></SfCalendar>

@code {
    [Inject]
    protected IJSRuntime JsRuntime { get; set; }
    protected override async Task OnInitializedAsync()
    {
        this.JsRuntime.Sf().LoadLocaleData(await Http.GetJsonAsync<object>("blazor-locale/src/ar.json")).SetCulture("ar");
    }
}

Right to left in Blazor Calendar