Comments (12)
@dharanidhanapalan see this example: http://react-day-picker.js.org/examples/disabling-interaction.html
from react-day-picker.
Not sure if call the props selectedDays
vs selected
or disabledDays
vs disabled
.
from react-day-picker.
While I like the simplicity of selected
/disabled
, I think that could imply that the entire component is somehow selected or disabled. It may be better to stick with selectedDay
/disabledDay
to be consistent with the existing API (renderDay
). I think it should be singular (selectedDay
/disabledDay
) rather than plural (selectedDays
/disabledDays
) because the argument for the function is for a single day, not a collection.
from react-day-picker.
Agreed! 👍
from react-day-picker.
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 disabled: DateUtils.isPastDay
I only need this because we use it to render statistics about past events (until yesterday).
Thanks!
from react-day-picker.
@emminnn please use the gitter room or open a new issue instead of asking things in an existing one :)
What I need is exactly opposite of
disabled: DateUtils.isPastDay
Then just return the opposite:
disabled: function(day) { return !DateUtils.isPastDay(day) }
from react-day-picker.
Ah, yes indeed. Awesome thx! Gotta study ES6 a bit 😆
from react-day-picker.
@emminnn nothing to do with ES6. The modifiers are functions that receive day
as first argument:
var modifiers = {
disabled: DateUtils.isPastDay
}
is same as
var modifiers = {
disabled: function(day) {
return DateUtils.isPastDay(day);
}
}
from react-day-picker.
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...
from react-day-picker.
Hi
I am using react-day-picker. It is really awesome. But I am still stuck in how to disable the click function for the disabled days . Can someone provide me a solution to proceed?
from react-day-picker.
@gpbl Thanks. I didn't notice that :( Got it 👍
from react-day-picker.
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?
from react-day-picker.
Related Issues (20)
- Bug: selected range is including selected days HOT 8
- Bug: redundant "rowgroup" role on <tbody> HOT 4
- rdp v8 types require allowSyntheticDefaultImports to compile HOT 6
- Bug: Documentation: Input Fields Example HOT 1
- feature: allow to set the selected style color
- Bug: captionLayout has no effect HOT 1
- Bug: changing captionLayout doesn't effect custom component rendering. HOT 3
- Bug: Using min breaks range selection with keyboard
- Bug: onPrevClick and onNextClick does not trigger
- Fix: Docs. Type alias: Matcher api reference page uses incorrect ";" in the examples
- Fix: Contributing.md line about proofreading the website links to an old deploy
- Bug: DayPicker does not automatically navigate to selected date
- Bug: Inline styles are not getting applied as intended, assistance needed please. HOT 1
- Bug: Lag when displaying many months and switching selected date HOT 1
- Bug: Dependency conflict with date-fns version 3.0.1 HOT 3
- Datepicker Allows Selection of Ranges with Disabled Days in Between HOT 1
- showOutsideDays is disabled 1st on month start always on Sunday HOT 1
- Hi! I'm not opening new issue because I think it can be somehow related with this one 🙂 HOT 3
- Disabled days can be selected with selected prop HOT 1
- Can't import the named export 'buildLocalizeFn' from non EcmaScript module (only default export is available)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-day-picker.