GithubHelp home page GithubHelp logo

Comments (3)

Nargonath avatar Nargonath commented on May 21, 2024

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.

t0gre avatar t0gre commented on May 21, 2024

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.

Nargonath avatar Nargonath commented on May 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.