-
-
Notifications
You must be signed in to change notification settings - Fork 32.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
[DatePicker] Add option to hide date display #6161
Conversation
By doing so, you lost the ability to choose the years |
@stunaz yes that is true, sorry I forgot to mention that. I figured it would be ok since you already have a |
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 extra option sounds fair to me.
did not add any unit tests because this is purely a visual change
There is no reason why visual changes shouldn't be tested. I would even advocate for the opposite, they are the most tricky ones.
It's more a changing rendering logic here. I small unit test at the React level would be great.
src/DatePicker/Calendar.js
Outdated
@@ -42,6 +42,7 @@ class Calendar extends Component { | |||
onTouchTapOk: PropTypes.func, | |||
open: PropTypes.bool, | |||
shouldDisableDate: PropTypes.func, | |||
showDateDisplay: PropTypes.bool, |
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.
I have some consideration for the naming convention and the API consistency. With boolean properties, we have two options. showX
/hideX
I think that we should be choosing based on the default value. That's basically what have been done at the HTML specification, e.g. disabled
, readonly
with the input in order to allow the shorthand.
Let's follow the same convention. with hideX
as the default is going to be false
.
TL;DR What about hideCalendarDate
?
#4949 would solve that. |
9548fde
to
947ea53
Compare
@oliviertassinari thanks for the feedback, I have renamed the prop and added unit tests for showing/hiding the date. It looks like TravisCI is failing due to lint errors in a couple unrelated files, I see at least one of them is already being addressed in #6182, not sure about the other one but I can add a fix on this PR if that would be helpful. |
Thanks. |
This adds an option to hide the date display above the date picker (or on the side on portrait mode). I did not add any unit tests because this is purely a visual change, but the code has been linted and docs have been added.
Thanks for the awesome library!