Coder Social home page Coder Social logo

Comments (4)

majapw avatar majapw commented on May 17, 2024 1

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.

majapw avatar majapw commented on May 17, 2024

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.

JimmyMultani avatar JimmyMultani commented on May 17, 2024

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.

JimmyMultani avatar JimmyMultani commented on May 17, 2024

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)

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.