Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug : Incorrect DatePicker "fa-IR" Culture #1793

Open
NabaviFard-Mahdi opened this issue Nov 16, 2024 · 1 comment
Open

Bug : Incorrect DatePicker "fa-IR" Culture #1793

NabaviFard-Mahdi opened this issue Nov 16, 2024 · 1 comment

Comments

@NabaviFard-Mahdi
Copy link

NabaviFard-Mahdi commented Nov 16, 2024

Describe the bug
DatePicker In "fa-IR" Cluture Dos not work correct
when select "today" date the inutbox show corrected date but the calendar dos not show correct
when select current date in calendar , the inputbbox dos not show correct date

To Reproduce

  1. Add Persian Culture in Program.cs
// Configure Persian culture
var persianCulture = new CultureInfo("fa-IR");
persianCulture.DateTimeFormat.Calendar = new PersianCalendar();
CultureInfo.DefaultThreadCurrentCulture = persianCulture;
CultureInfo.DefaultThreadCurrentUICulture = persianCulture;
builder.Services.Configure<RequestLocalizationOptions>(options =>
{
    var supportedCultures = new[]
    {
        persianCulture
    };
    options.DefaultRequestCulture = new RequestCulture("fa-IR");
    options.SupportedCultures = supportedCultures;
    options.SupportedUICultures = supportedCultures;
});
  1. add demo RadzenDatepicker in index.razor
<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" AlignItems="AlignItems.Center" Gap="0.5rem" class="rz-p-12">
    <RadzenLabel Text="Select Date" Component="DatePickerHourFormat" />
    <RadzenDatePicker @bind-Value=@value ShowTime="true" HourFormat="12" DateFormat="MM/dd/yyyy h:mm tt" Name="DatePickerHourFormat" />
</RadzenStack>


<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" AlignItems="AlignItems.Center" Gap="0.5rem" class="rz-p-12">
    <RadzenLabel Text="Select Date" Component="DatePickerFooterTemplate" />
    <RadzenDatePicker @bind-Value=@value Name="DatePickerFooterTemplate">
        <FooterTemplate>
            <RadzenButton Click=@(args => value = DateTime.Now) Text="Today" Style="width: 100%;" class="rz-my-4" />
        </FooterTemplate>
    </RadzenDatePicker>
</RadzenStack>
  1. run and test

Expected behavior
correct show date in "fa-IR" culture

Screenshots
2
2-2
peek_3

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Chrome Version 130.0.6723.117 (Official Build) (64-bit)
  • Version Radzen v5.6.1
  • Dotnet 8.0.403

Additional context

@NabaviFard-Mahdi NabaviFard-Mahdi changed the title Incorrect DatePicker "fa-IR" Culture Bug : Incorrect DatePicker "fa-IR" Culture Nov 16, 2024
@enchev
Copy link
Collaborator

enchev commented Nov 21, 2024

We are not familiar with "fa-IR" culture and Persian calendar, feel free to submit pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants