An easy to use date picker tool for react projects.
It is written in TypeScript with MobX state manager.
- Node.js
- React
- MobX
- Install build version from npm with
npm install @malfeitor/date-picker
- OR clone this repo to get dev version with
git clone https://github.com/malfeitor/date-picker.git
- Import to your project :
import {DatePicker} from '@malfeitor/date-picker'
- Create a ref (if you use TS, it's an HTMLInput ref) :
const datePickerRef = useRef(null)
- Add the component to your page :
<DatePicker ref={datePickerRef} />
- Use the value when needed :
datePickerRef.current.value
- (required)
ref
: the ref you'll use to access input's data - (optional)
format
: the date format you want to have in your input, use YYYY for year, MM for month and DD for day (default:YYYY-MM-DD
) - (optional)
language
: the short language letters, onlyfr
anden
available for now (default: en) - (optional)
weekStartingDay
: the first day of you weeks (default: Sunday)