Comments (3)
FWIW I managed to do it with the existing API using minBookingDate
, maxBookingDate
and isDateBlocked
. The first two fields were set respectively to the lower and higher date within all the ranges. In the latter I just compared the date given to the ranges to determine whether it was contained within or not. Worked like a charm.
I leave it open in case you want to provide some kind of first class citizen feature otherwise feel free to close the issue. Thanks 🙏 .
from react-datepicker.
Hi @Nargonath sorry it took me a while to respond. I took over maintaining the project recently but hadn't realized GitHub wasn't notifying me of new issues.
Glad to hear you got it working. If I understand correctly, it sounds like your solution would work well when the difference between date ranges for different years is quite small, but might be hard for e.g. when there's no overlap between the date ranges for different years? If so, I will mark it as a feature request and leave it open.
from react-datepicker.
hello @tomgreenwood1 . Thanks for stepping up and maintaining this package. Don't worry I know how it is working on open-source projects. 😄
i'm actually retrieving the active date ranges from a backend where that I don't manage myself. We definitely can have multiple months or even a year difference between ranges. I didn't notice any performance implication so far though. We have a wrapper around the datepicker range component and our component receive the ranges list and we use isDateBlocked
to check whether a specific date is within the range list passed as prop. Not sure what you mean by hard though. The code doesn't change based on range size or period between them. Feel free to tell me if you need more information, I'm not sure I answered your question properly.
from react-datepicker.
Related Issues (20)
- pass readonly as props for startDate and endDate input
- dayHoverRangeBorderColor not used in Day styles
- Is there any way to specify month days?
- DateSingleInput - onFocusChange prop. Issue with invalid characters displaying to user. Date validation.
- System Accepts 00 as entry field when user keys in date.
- Is there any way to create a border radius effect on the input?? HOT 2
- Wrong Typescript type annotations HOT 1
- Request to add onNextMonthClick and onPrevMonthClick HOT 1
- Close button modification
- TabIndex return -1
- Support react 18
- Problem with arrow keys on latest version
- initialVisibleMonth ignored when startDate and endDate are set
- Prevent to hide datepicker when clicking anywhere, but close it when clicking close button
- Prevent to hide datepicker HOT 1
- Input losing focus when I used arrows in datepicker HOT 8
- Is Possible create isStartDate and isEndDate? HOT 1
- React native HOT 1
- No event triggered when typing non-date-related input HOT 3
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-datepicker.