What is the best way to use the latest version of eonasdan datetimepicker in react
The project url: https://eonasdan.github.io/bootstrap-datetimepicker
What is the best way to use the latest version of eonasdan datetimepicker in react
The project url: https://eonasdan.github.io/bootstrap-datetimepicker
You asked this question 6 months ago, as of today you can use the Tempus Dominus Bootstrap plugin with React through this library:
https://github.com/tonix-tuft/react-tempusdominus-bootstrap
Tempus Dominus Bootstrap is the Eonasdan's jQuery plugin based on Bootstrap 4, and it's the successor of the
bootstrap-datetimepickerplugin you mention in your question (which uses Bootstrap 3).Installation
Install peer dependencies as well:
Usage
Import the required styles in your JS entry point file:
Or in you Sass/SCSS main file:
Then import and use the provided
DateTimePickercomponent in your JSX code:In the above example, the first
DateTimePickercomponent is a controlled one as it sets thedateprop explicitly and won't change its date if the state of the consuming component doesn't change, whereas in the second example the component is uncontrolled.You can find all the documentation on the repo's page as well as check out the demo here.
I hope this answers your question (it should :) ).