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 hour 12 displayed as 0 #3418

Closed
cain opened this issue Jul 14, 2021 · 5 comments
Closed

Timepicker hour 12 displayed as 0 #3418

cain opened this issue Jul 14, 2021 · 5 comments

Comments

@cain
Copy link
Contributor

cain commented Jul 14, 2021

Overview of the problem

Buefy version: Latest
Vuejs version: -
OS/Browser: -

Description

Timepicker component hour selector shows "12". But once selected the hour displayed is "0".

Looking into it, seems like 0 PM or 0 AM is correct. But maybe we want to support a way to display as 12 PM?

Steps to reproduce

  1. Use timepicker component
  2. Use 12 hour formate
  3. Select hour 12
  4. See value displayed

Expected behavior

Display hour value as "12"

Actual behavior

Hour value displaying as "0" for both PM and AM values

Example on docs: https://buefy.org/documentation/timepicker
CleanShot 2021-07-14 at 11 36 39@2x

@jtommy jtommy added the bug label Aug 6, 2021
@jtommy jtommy removed the bug label Aug 25, 2021
@jtommy
Copy link
Member

jtommy commented Aug 25, 2021

@cain I investigated about and it's relative to Intl.DateTimeFormat because internally the component use it (you can override it anyway).
An official bug of Intl.DateTimeFormat ?

@jtommy jtommy closed this as completed Aug 25, 2021
@cain
Copy link
Contributor Author

cain commented Aug 26, 2021

@jtommy thanks for looking, i also had a look and it turns out 0 is the "correct" display. Thanks ill use the override :)

@cain
Copy link
Contributor Author

cain commented Oct 26, 2021

@jtommy Buefy uses the hour12 option which converts 12 pm to 0 pm.

Changing this to use hourCycle: 'h12' worked instead of hour12: true

Do you think the default Buefy format function needs to be updated to use this param instead?

See https://stackoverflow.com/questions/63273543/javascript-intl-datetimeformat-hours12-gives-odd-output-on-chrome

CleanShot.2021-10-27.at.09.37.27.mp4

@jtommy
Copy link
Member

jtommy commented Oct 27, 2021

@cain yes, please make a PR

@jezmck
Copy link

jezmck commented Mar 7, 2023

This is likely because of https://bugs.chromium.org/p/chromium/issues/detail?id=1347316

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

No branches or pull requests

3 participants