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

LocaleDate displays incorrect time format for certain locales #2970

Closed
williamrijksen opened this issue Jul 23, 2024 · 1 comment · Fixed by #2972
Closed

LocaleDate displays incorrect time format for certain locales #2970

williamrijksen opened this issue Jul 23, 2024 · 1 comment · Fixed by #2972
Labels
contributions welcome P3: minor Non-critical, no workarounds exist type: bug 🐛 Something isn't working @vendure/admin-ui

Comments

@williamrijksen
Copy link

Describe the bug
The I18n LocaleDate shows a 12-hour format, while in my country it should not show AM/PM, but a 24-hour format instead.

To Reproduce
Steps to reproduce the behavior:

  1. Make sure the locale of your browser is set to NL_nl.
  2. Login.
  3. Open the orders.
  4. Notice that the time is shown in the 12-hour format.

Expected behavior
I expect the time to be displayed in the format of my locale, which is a 24-hour format.

Environment:
@vendure/core version: v3

@williamrijksen williamrijksen added the type: bug 🐛 Something isn't working label Jul 23, 2024
@michaelbromley
Copy link
Member

Thanks for opening the issue.

This behaviour is controlled by the hour12 property.

From the MDN docs (my emphasis added):

Whether to use 12-hour time (as opposed to 24-hour time). Possible values are true and false; the default is locale dependent.

Looking at the localeDatePipe source code I can see that we are explicitly setting hour12: true,.

So we should just be able to omit this property and then the correct format will be used for the current locale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributions welcome P3: minor Non-critical, no workarounds exist type: bug 🐛 Something isn't working @vendure/admin-ui
Projects
Status: 🚀 Shipped
Development

Successfully merging a pull request may close this issue.

2 participants