Comments (3)
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.
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.
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)
- Unable to use clear() method
- Bump flatpickr to 4.6.13 (fix issues) HOT 3
- The style is not working
- Clear date does not trigger onChange
- TypeError: _this.flatpickr.setDate is not a function in Jest after upgrading to CRA 5 HOT 1
- x
- Convert a selected date range in Flatpickr
- The calender component should support for testing purpose
- is there a way to use monthSelectPlugin , this doesnot seems to work ? HOT 2
- Lazy loading crashes Flatpickr HOT 1
- Conjunction config option not working when set to "\n"
- Mobile datepicker gets rendered twice when using Nextjs 13 HOT 2
- esbuild Incompatibility with Babel Versions Below 7.14.0
- In the mode selector for time user is able to enter more that 2 digit and not valid time in the timer input.
- umd packaging
- No updation on blur
- monthSelectPlugin error on mobile view
- Uncaught Error: Element type is invalid
- Year input value changes unexpectedly on pressing Enter.
- Flatpickr instance is available at `flatpickr` rather than `_flatpickr` as main docs say
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-flatpickr.