Skip to content

fix: Format in FluentTimePicker #3951

@davhdavh

Description

@davhdavh

🐛 Bug Report

It seems that FluentTimePicker uses the current culture to format the input.value, but the time input spec requires a very specific format: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-time-string

💻 Repro or Code Sample

e.g. in Firefox desktop: Set browser to en_US, set blazor culture to da_DK. Every time time you change time there is a browser warning that xx.xx is not a valid time, and the display remains "--:--"

The specified value "11.48" 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.

Image

Chrome/Edge requires you to change the OS lang.

💁 Possible Solution

Force FormatValueAsString and TryParseValueFromString to always use HH:mm as per spec. And update current-value to use FormatValueAsString

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions