Comments (4)
Oh man, I was totally incorrect in my response. I thought you were trying to use the SingleDatePicker
component. You are right, neither of the isOutsideRange
or isDayBlocked
props apply to the DayPicker
. You have to use the modifiers
prop to wrangle it to what you want to do. I've detailed some of this in #82 (comment). Let me know if this helps!
from react-dates.
enableOutsideDays
refers to days in the table belonging to the previous and next month (ie August 31st or October 1st for this month). It is set to false by default so you don't necessary need that. By default past days are disabled using the isOutsideRange
prop. You can also use isDayBlocked
for more granularity. Does this answer your Q?
isOutsideRange indicates which days are out of selectable range. Past dates out of range by default. If you would like to allow the user to select days in the past, you may set isOutsideRange to () => false.
Right now we have an expectation that this function returns true for a continuous range of dates from -Infinity to some date and/or from some date to +Infinity. This is relevant to the minimum nights logic. If you would like to prevent the user from selecting a non-continuous set of dates, you should use isDayBlocked instead.
from react-dates.
Hey @majapw,
isOutsideRange
doesn't seem to work for <DayPicker />
. I am still able to click on past days, when I shouldn't be.
I think I might be using this incorrectly, but I'm not really sure.
Any assistance would be greatly appreciated.
Thank you.
from react-dates.
Hey @majapw,
You're example code helped tremendously on explaining what I wasn't doing correctly.
Thank you so much!
from react-dates.
Related Issues (20)
- wrong height on month transitions HOT 3
- How to disable the preselected dates HOT 3
- Installation command results in error HOT 2
- Focus jumps to End Date before user is finished typing Start Date
- Cannot Use verticalScrollable DayPickerRangeControllerWrapper renders Empty HOT 1
- problem SingleDatePickerInput
- Overlap behavior when date pickers are vertically stacked
- DayPickerRangeController does not change visible month when startDate or endDate update from state value HOT 4
- Question: Is there a predefined way to change the months' language? HOT 1
- Accessibility issue with shortcut panel close button
- click date input randomly triggers outside click
- Unable to test with DateRangePicker HOT 10
- Three interesting questions about border-radius in cells, years and holidays HOT 1
- isOutsideRange property ends up nullifying invalid dates entirely HOT 5
- manually force refresh/render of blockedday
- problem with react HOT 1
- Change the width of calender in daterangepicker
- Allowing past dates is messing with dates selection at DayPickerRangeController component HOT 5
- I can't change React-Dates Language! HOT 6
- SingleDatePicker - Cannot open dialog from question mark button using Enter key.
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-dates.