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

TimePicker am/pm format wrong #1196

Closed
elylv opened this issue Mar 15, 2021 · 3 comments
Closed

TimePicker am/pm format wrong #1196

elylv opened this issue Mar 15, 2021 · 3 comments
Labels
bug Something does not work as intended/expected
Milestone

Comments

@elylv
Copy link

elylv commented Mar 15, 2021

When AmPm format is selected for the TimePicker, the hours have a leading zero, which is generally not used (in the US, at least).

e.g.
05:45 PM
would normally be written as:
5:45 PM

I believe this also prevents confusion, as I, as a 24hr clock guy, might read "05:45 PM" as "05:45" in the morning because of the leading zero.

For reference, the en-US culture ShortTimePattern string is "h:mm tt", i.e. only one h rather than hh. I'm not sure if this is universal for all countries which use 12-hour format, so perhaps a better solution would be to allow the time format string to be passed in, rather than a simple boolean for AmPm, much like the DateFormat works for the datepicker.

@elylv elylv added the bug Something does not work as intended/expected label Mar 15, 2021
@elylv
Copy link
Author

elylv commented Mar 19, 2021

Also, when TimePicker is set to AmPm format, and bound to a value, the value will initially show in 24hr format in the textbox. It only switches to 12hr format once the value is changed via the picker.

e.g.
Timespan "00:01" with AmPm set to true
<MudTimePicker Time="TimeSpan.FromSeconds(60)" AmPm="true" />
Value displays initially as:
image
(should show as "12:01 am")
Once the picker is used and a value selected via the picker, the correct format shows:
image

@elylv
Copy link
Author

elylv commented Apr 23, 2021

Any update on this one? Getting some comments from my American users who are also seeing this inconsistency.

@henon
Copy link
Collaborator

henon commented May 9, 2021

merged.

@henon henon added this to the 5.0.9 milestone May 9, 2021
@henon henon closed this as completed May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something does not work as intended/expected
Projects
None yet
Development

No branches or pull requests

2 participants