Completed
Last Updated: 14 Nov 2024 09:28 by ADMIN
Release 7.0.0
Tim
Created on: 29 Oct 2024 17:40
Category: DateInput
Type: Bug Report
0
Default Format Attribute not updating correctly on Culture Change

Used a MacBook Pro for this test.

  • Used the Telerik UI for Blazor Productivity Tools extension in VS Code
  • Launch - Telerik UI for Blazor Template Wizard
    • template - dashboard
    • telerik version 5.1.1
    • enable localization
    • .net 7.0
  • Create a razor file with the TelerikDatePicker component and a binded value attribute for selected date
    • The selected date variable should be set to a default DateTime value
      • I used new DateTime(2024,9,1)
    • The attribute Format is not used in the component
    • Below the component show the value for the System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern variable
  • Comment out all TileLayoutItems from Tile Layout
  • Add DatePicker component to a TileLayoutItem
  • In your terminal run dotnet watch to run the app
    • English is the culture in the top right
    • The format of the default date in the datepicker should be MM/dd/yyyy
      • Date is 9/1/2024
      • ShortDatePattern is M/d/yyyy
    • Switch the culture to German
    • The format of the date value should be dd.MM.yyyy
      • Date is 9.1.2024
      • ShortDatePattern is dd.MM.yyyy

    1 comment
    ADMIN
    Dimo
    Posted on: 30 Oct 2024 12:02

    Hi Tim,

    Thanks for the provided runnable app and detailed description.

    I reproduced the problem and found the cause in our source code. The fix is already awaiting approval. In the meantime, there is an easy workaround:

    <TelerikDatePicker Format="@CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern" />

    I am awarding you some Telerik points for the bug report. I am also converting your ticket to a public bug report for better visibility in our community.

    Regards,
    Dimo
    Progress Telerik

    Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.