vikramlearning / blazorbootstrap

An Enterprise-class Blazor Bootstrap Component library built on the Blazor and Bootstrap CSS frameworks.
https://docs.blazorbootstrap.com/
Apache License 2.0
650 stars 29 forks source link

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

Open eerojaaskelainen opened 1 month ago

eerojaaskelainen commented 1 month ago

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

(Specified value reflects to desired value)

Expected behavior Time should be updated to control and variable

Screenshots BlazorTimePickerLocaleFault

Versions (please complete the following information):

Sample code

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

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

GitHub repo N/A

Desktop (please complete the following information):

gvreddy04 commented 1 month ago

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