React Date Picker
A simple and reusable Datepicker component for React (with persian jalali calendar support) Demo.
This package uses react-persian-datepicker project under the hood.
The package can be installed via NPM:
npm install react-datepicker-persian --save
At this point you can import react-datepicker-persian and its styles in your application as follows:
;// Be sure to include styles at some point, probably during your bootstrapping;
Below is a simple example on how to use the Datepicker in a React view. You will also need to require the css file from this package (or provide your own). The example below shows how to include the css from this package if your build system supports requiring css files (webpack is one that does).
You can also use the standalone build by including react-datepicker-persian.js and react-datepicker-persian.css in your page. (If you do this though you'll also need to include the dependencies.) For example:
The most basic use of the DatePicker can be described with:
<DatePicker onChange= this value=thisstatevalue />
master branch contains the latest version of the datepicker-fa component. To start your example app, you can run
npm install then
npm start. This starts a simple webserver on http://localhost:8080.
- Write some tests
- Better documentation
- UI improvements
- Remove classnames dependency
- moment-jalaali - A Jalaali (Jalali, Persian, Khorshidi, Shamsi) calendar system plugin for moment.js.
Special thanks to @mohebifar for his open-source project which this component is based on.
Contributions are welcome and will be fully credited. I'd be happy to accept PRs for that.