Pass down options to Flatpickr on the DatePicker component
See original GitHub issueSummary
It would be nice to be able to pass down to Flatpickr itself some options that are you can’t set on the flatpickr instance itself (ie. inline: true
)
In the React DatePicker component it’s a matter of adding a prop and then spreading it when initing flatpickr
Justification
We do have the need to have an inline/static picker on carbon-addons-iot for this story
As it right now, we are reparenting the calendar DOM into our component but this is far from the best option to do it.
Specific timeline issues / requests
For now we are going with the workaround but it would be nice to have soon 😃
Available extra resources
I can contribute back myself but I need some support from the Carbon team given that adding a new prop to DatePicker would break semver.
Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Options
Config Option Type Default
altFormat String "F j, Y"
altInput Boolean false
altInputClass String ""
Read more >How do you pass options to Django-flatpickr date picker?
So what I'm really looking for is to be able to pass the dates that can't be selected to the datetime picker instance...
Read more >Input date and time in HTML and Javascript || (flatpickr.js)
How to create a Javascript Datetime Picker with flatpickr.js that works with Bootstrap.Can be applied to date/datetime/datetime-local/any ...
Read more >Date Picker
The DatePicker component utilizes Flatpickr under the hood. We will pass any extra options down to the FlatPickr instance. · The DatePickerInput takes...
Read more >react-booking-form
... the date picker that should accept the inputComponent as a "launcher" for ... that will be passed down to the flatpickr React...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It was originally intentional to not include the inline format for datepicker. I think if we wanted to include it, it would need some visual exploration because of the calendar icon. This topic needs some investigation from the design perspective before we can determine if we should do it or not.
Any discussion still being had on this?