@malfeitor/date-picker
v1.2.1
Published
A react component who pick dates.
Downloads
383
Readme
React Date Picker
An easy to use date picker tool for react projects.
It is written in TypeScript with MobX state manager.
How to use it
Prerequisites
- 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
Instructions
- 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
Properties
- (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)