Giter Site home page Giter Site logo

Comments (12)

gpbl avatar gpbl commented on May 19, 2024 1

@dharanidhanapalan see this example: http://react-day-picker.js.org/examples/disabling-interaction.html

from react-day-picker.

gpbl avatar gpbl commented on May 19, 2024

Not sure if call the props selectedDays vs selected or disabledDays vs disabled.

from react-day-picker.

basham avatar basham commented on May 19, 2024

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.

gpbl avatar gpbl commented on May 19, 2024

Agreed! 👍

from react-day-picker.

emminnn avatar emminnn commented on May 19, 2024

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.

gpbl avatar gpbl commented on May 19, 2024

@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.

emminnn avatar emminnn commented on May 19, 2024

Ah, yes indeed. Awesome thx! Gotta study ES6 a bit 😆

from react-day-picker.

gpbl avatar gpbl commented on May 19, 2024

@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.

emminnn avatar emminnn commented on May 19, 2024

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.

dharanidhanapalan avatar dharanidhanapalan commented on May 19, 2024

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.

dharanidhanapalan avatar dharanidhanapalan commented on May 19, 2024

@gpbl Thanks. I didn't notice that :( Got it 👍

from react-day-picker.

tamizharasank avatar tamizharasank commented on May 19, 2024

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)

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.