-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
Conversation
There was a problem hiding this 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.
} | ||
|
||
export const getFormattedTime = (refParts: DatetimeParts, use24Hour: boolean): string => { | ||
if (refParts.hour === undefined || refParts.minute === undefined) { return 'Invalid Time'; } |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Pull request checklist
Please check if your PR fulfills the following requirements:
npm run build
) was run locally and any changes were pushednpm run lint
) has passed locally and any fixes were made for failuresPull request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: resolves #23768
What is the new behavior?
Does this introduce a breaking change?
Other information