-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
DateTimePicker
: fix date format when switching to 12-hour time format
#37465
Conversation
Thank you very much for working on this feature, @amustaque97 |
Hey @amustaque97 , thank you for looking into this! You definitely spotted an inconsistency between what is documented and how the component behaves. I'm not sure, though, that the fix proposed here is right one. The docs for the
Judging by how the code was written (including tests written specifically for that condition) and by this sentence, I'm inclined to think that the desired behavior here would be to:
In this perspective, I would say the the behavior of the component is currently the opposite of what we'd like it to be. My inclination here is to:
|
dayMonthFormat
variableDateTimePicker
: fix date format when switching to 12-hour time format
@ciampo thank you so much for taking time to review my PR 😄 . |
I was not aware of the slack conversation, where it was also assumed that currently, the bug is caused by the logic being the other way around of what it should be. It was also discussed that tying the date format ( So, what next? We could remove the
A simpler approach would be to merge a quick fix in this PR (switch the logic of the What do folks think? |
What you're referring to are these date formatting settings / parameters. Here's a few personal considerations:
In the light of the above, I would recommend to split the work in 2 parts:
|
Sure, make sense.
Please review the PR and let's don't delay it.
Agree with you, I will create a new issue. |
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.
Please review the PR and let's don't delay it.
Sure! As mentioned above, this PR should simply invert the is12Hour
check (I've added an inline comment to explain that more explicitely).
We should then:
- adjust the unit tests accordingly
- add a CHANGELOG entry
- potentially add more details to the
is12Hour
prop description, to add more clarity around the fact that the date format isDD-MM-YYYY
when that prop isfalse
Thank you! It'd be great if you linked it back here once you've created it :) |
I have addressed review comments. |
I have created an issue to introduce new props |
Please don't review PR. I need a day time to review it myself thoroughly. I'm feeling that I have done something wrong. It's late here (going to bed)! Will check it tomorrow. |
cc @ciampo and @paaljoachim Feel free to review PR |
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.
Code changes LGTM, the date format is now aligned with the docs
default | is12Hour = true |
---|---|
Just left a couple of minor inline comments, once they're addressed we can merge this PR! Thank you @amustaque97
Co-authored-by: Marco Ciampini <marco.ciampo@gmail.com>
Co-authored-by: Marco Ciampini <marco.ciampo@gmail.com>
Some e2e tests are failing, likely unrelated to the changes in this PR. @amustaque97 , would you mind rebasing on top of latest |
Fixes: #17970
Description
Updated the
TimePicker
component to show time inMM-DD-YYYY
format as mentioned in the docsHow has this been tested?
TimePicker
componentScreenshots
Types of changes
Bugfix
Checklist:
*.native.js
files for terms that need renaming or removal).