Giter Site home page Giter Site logo

Comments (3)

jacobmischka avatar jacobmischka commented on July 28, 2024

I don't believe minDate, maxDate, or dateFormat are supported props for this component. The only supported props are the ones listed in propTypes, which are the hooks, value, defaultValue, and children.

We don't currently pass any non-hook options to flatpickr, at least not intentionally.

Please let me know where we're currently doing that if we are, it's not intended.

from react-flatpickr.

ZeHiro avatar ZeHiro commented on July 28, 2024

I think I didn't explain myself. I would like to use the component like this :

<FlatPicker
   minDate={'aDate'}
   maxDate={'anotherDate'}
   dateFormat='d/m/y'
/>

This is not possible right now, an we have to use the options objects to pass them down.

But if maxDate, minDate etc were added to the hooks array, they would be automatically transfered to the flatpicker object, and not passed as props to the input.

from react-flatpickr.

jacobmischka avatar jacobmischka commented on July 28, 2024

Ah. Sorry, currently the intended way to do this is to pass it via the options object as you realized.

Those options aren't hooks, they're just configuration options. Hooks are an outlier, currently we keep track of all hooks because we need to ensure they're passed to flatpickr as an array. Since we're keeping track of them anyway, allowing them to be specified as props isn't much extra work. But I don't want to add to that and couple this package even more with changes to flatpickr options.

Sorry!

from react-flatpickr.

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.