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

feat(input-time-picker): add hour-format property #10059

Open
wants to merge 58 commits into
base: dev
Choose a base branch
from

Conversation

eriklharper
Copy link
Contributor

Related Issue: #4756

Summary

This PR exposes a new hour-format property to input-time-picker and time-picker that overrides the locale's default hourCycle setting, allowing a 12-hour locale to be formatted in 24-hour time and vice versa.

… value of 0:0:0 resulted in a clearing of the value
… where we need to set the localized input value. Also fixed a place where localized meridiem wasn't being set properly.
…we can determine hourcycle from just the locale. Refactored input-time-picker to match time-picker in how it updates locale state when it changes, including setting a default hourCycle when one is not provided.
… on hourCycle. Not perfectly working, but we'll need this to get to the next step which is to parse both 12 and 24 hour formats. Fixing Arabic locale time format overrides to match ICU.
…alue to nil. Also adding comprehensive locale typing tests, need to expand a bit more and fix a few locales still
…ult locales by correcting the regex to capture whitespace characters on either side of the meridiem tokens in the time format string
…l supported locales to test that render meridiem to the left of the time value
…t seem to like a lot of the localized meridiem formats, so we may want to ship this with the caveat that it might not work just right for all locales
eriklharper and others added 18 commits September 10, 2024 16:57
…er key and committing on blur using selectText util
… localized am and pm by removing the space, negating the need to consider the meridiem order.
…and other elements in the format token replacement logic
…g in the e2e test environment, so need to figure out how to workaround this
…preserve the order coming back from Intl.DateTimeFormat
… test environment is formatting as if it was es, refactoring demo page to work in Firefox and Safari
@eriklharper eriklharper marked this pull request as ready for review September 19, 2024 23:22
Copy link
Member

@geospatialem geospatialem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Have a few doc considerations below 📚

@eriklharper eriklharper requested a review from a team September 20, 2024 17:03
….com:Esri/calcite-design-system into eriklharper/4756-time-picker-24-hour-support
Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions.

@github-actions github-actions bot added the Stale Issues or pull requests that have not had recent activity. label Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues tied to a new feature or request. Stale Issues or pull requests that have not had recent activity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants