-
-
Notifications
You must be signed in to change notification settings - Fork 727
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
Special modifiers: disabled and selected #34
Comments
Not sure if call the props |
While I like the simplicity of |
Agreed! 👍 |
Hi! Thanks for the great module. After trying several different ones, have decided to stick with this one due to simplicity to configure. Though I got stuck somewhere, maybe the easiest part! 😆 . I need to disable all the future days besides today. How can I do that? What I need is exactly opposite of Thanks! |
@emminnn please use the gitter room or open a new issue instead of asking things in an existing one :)
Then just return the opposite: disabled: function(day) { return !DateUtils.isPastDay(day) } |
Ah, yes indeed. Awesome thx! Gotta study ES6 a bit 😆 |
@emminnn nothing to do with ES6. The modifiers are functions that receive var modifiers = {
disabled: DateUtils.isPastDay
} is same as var modifiers = {
disabled: function(day) {
return DateUtils.isPastDay(day);
}
} |
Yes I figured that out, just that when I tried to write it in ES6 as you did it in examples, it didn't work, cause I did it wrong :/. Therefore I didn't even try the regular JS functions... 😖 Thanks a lot! I indeed have another question, but will bring that up in another issue... |
Hi |
@gpbl Thanks. I didn't notice that :( Got it 👍 |
Hi Team, I'm also using react-day-picker. It is really superb. But I am still stuck in how to disable the whole dayPicker module. Can someone provide me a solution to proceed? |
It is very common for a date picker to work with selected and disabled days. While it is already possibile to implement
disabled
andselected
modifiers, we could give them a special treatment to change the component's behavior. Example:aria-selected
andaria-disabled
attributes (see Add ARIA attributes for better accessibility #33)disabled
modifier may also prevent to attach click or touchtap events to those daysmodifiers
prop):The text was updated successfully, but these errors were encountered: