-
Notifications
You must be signed in to change notification settings - Fork 78
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
Enhancement: l10n support for input-time-picker and time-picker components #1475
Comments
From Erik It looks promising to see that the Intl.DateTimeFormat api supports locale formatting through this similar formatToParts API that I used to add number locale support https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatToParts so it looks like we would do something quite similar for time formats as well. We would simply extract the time components based on the provided locale and arrange the components as appropriate in the UI. |
@babakbolour can you take a look at this one |
I18n Considerations
|
Installed and assigned for verification. |
Currently the |
From Erik: |
Verified on
We don't document global attributes, but do you think this should be mentioned somewhere due to the caveat? @jcfranco @macandcheese |
I tested all languages here: Some don't seem to place the am/pm correctly. I don't know which version is right, but it should be the same between |
Calcite Input picker is the right format. AM/PM should be placed before the hour :minutes |
To recap: This issue here was about translating the time into different languages, e.g. am/pm. The main part of this is fixed now. What's left here is that in LTR languages ZH and KO the am/pm is on the wrong side in |
Installed and assigned for verification. |
Closing this and we'll continue discussion of the issue in #3883. |
Description
Adds locale-specific formatting to
calcite-time-picker
andcalcite-input-time-picker
based onIntl.DateTimeFormat
.Acceptance Criteria
Formats time appropriately based on locale in both the popup time-picker UI and in the corresponding input.
Relevant Info
Consult
calcite-date
for implementation details, which will be similar.Which Component
calcite-time-picker
,calcite-input-time-picker
Example Use Case
Resources
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatToParts
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat
The text was updated successfully, but these errors were encountered: