It is a simple Datepicker component using React JS. Full documentation can be found in Github
This is a Simple datepicker component using React JS. It has no other dependencies apart from React JS.
To install it from npm
use
npm install the-datepicker-react --save
Cloning the repository directly from Github
git clone https://github.com/anijitsao/the-datepicker-react.git
This datepicker component uses Fontawesome for the icons. So, include Fontawesome library in the index.html
by
<link
rel="stylesheet"
href="<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css" integrity="sha512-1PKOgIY59xJ8Co8+NE6FZ+LOAZKjy+KY8iq0G4B3CyeY6wYHN3yt9PW0XpSriVlkMXe40PTKnXrLnZ9+fkDaog==" crossorigin="anonymous" referrerpolicy="no-referrer" />"
/>
Or can be downloaded from npm and included in the project.
Import the component in your application by,
import ReactSimpleDatepicker from "the-datepicker-react;"
If you are using the source code directly,
import ReactSimpleDatepicker from "/path/to/the-datepicker-react/ReactSimpleDatepicker.js;"
Now render the datepicker component into your application use
const onSelectedDateHandler = (date) => {
console.log("date received", date);
}
<ReactSimpleDatepicker onSelectedDate={onSelectedDateHandler} />