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

TimeInput: Cannot set time with non-english locales #788

Open
eerojaaskelainen opened this issue Jul 5, 2024 · 1 comment
Open

TimeInput: Cannot set time with non-english locales #788

eerojaaskelainen opened this issue Jul 5, 2024 · 1 comment

Comments

@eerojaaskelainen
Copy link

Describe the bug
TimeInput cannot set time when CultureInfo.CurrentCulture.DateTimeFormat is not what JS expects.
This occurs at least in Finnish Windows locale (where time is presented in H.mm).

To Reproduce

  1. Create Blazor component with TimeInput control
  2. Change System.Globalization.CultureInfo.CurrentCulture and System.Globalization.CultureInfo.CurrentUICulture to Finnish ("fi")
  3. Run component
  4. (Pick time, or type from keyboard)

Current behavior

  • Control shows '--.--'
  • Following message is printed in console:

blazor.web.js:1 The specified value "00.00" does not conform to the required format. The format is "HH:mm", "HH:mm:ss" or "HH:mm:ss.SSS" where HH is 00-23, mm is 00-59, ss is 00-59, and SSS is 000-999.

(Specified value reflects to desired value)

Expected behavior
Time should be updated to control and variable

Screenshots
BlazorTimePickerLocaleFault

Versions (please complete the following information):

  • .NET Version: .NET 8.0.302
  • BlazorBootstrap: 2.2.0
  • Blazor WebAssembly / Server: Server
  • Blazor Interactive Render Mode: Server
  • Blazor Interactivity Location: Global

Sample code

<TimeInput @bind-Value="StartTime" TValue="TimeOnly" />

@code {
  private TimeOnly StartTime { get; set; } 
}

GitHub repo
N/A

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Chrome
  • Version: 126.0.6478.127
  • Browser locale: Finnish (fi)
  • System locale: Finnish (fi)
@gvreddy04
Copy link
Contributor

@eerojaaskelainen Thank you for trying BlazorBootstrap, I will take a look at the issue mentioned above.

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

No branches or pull requests

2 participants