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

fix(datetime): time picker uses new iOS 15 style #23996

Merged
merged 14 commits into from
Oct 5, 2021
Merged

fix(datetime): time picker uses new iOS 15 style #23996

merged 14 commits into from
Oct 5, 2021

Conversation

liamdebeasi
Copy link
Contributor

@liamdebeasi liamdebeasi commented Sep 29, 2021

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: resolves #23768

What is the new behavior?

  • Adds keyboard support to time picker for typing in values
  • Uses new iOS 15 wheel style

Does this introduce a breaking change?

  • Yes
  • No

Other information

@github-actions github-actions bot added the package: core @ionic/core package label Sep 29, 2021
Base automatically changed from feat-picker to next October 4, 2021 15:36
@liamdebeasi liamdebeasi marked this pull request as ready for review October 4, 2021 15:37
Copy link
Contributor

@averyjohnston averyjohnston left a comment

Choose a reason for hiding this comment

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

This looks great! I only found a couple nitpicky things; honestly I could see this being shipped as-is.

core/src/components/datetime/datetime.tsx Outdated Show resolved Hide resolved
}

export const getFormattedTime = (refParts: DatetimeParts, use24Hour: boolean): string => {
if (refParts.hour === undefined || refParts.minute === undefined) { return 'Invalid Time'; }
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this also warn if the user tries to pass a logistically invalid time, like 25 for the hour?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could, but the refParts that gets passed in is created via users selecting options in datetime that we create so there's no user generated content there. I believe datetime will error out if you pass in an invalid ISO 8601 string into the value field for user generated content. I can add a check if you think it would be valuable though.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nah, if the only way to enter a custom time is through an ISO string, we should be good 👍 Just wanted to make sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants