date-picker-typescript
v1.1.1
Published
A small datepicker developped with Vite/Typescript and React.
Downloads
4
Readme
date-picker-typescript
A small datepicker developped with Vite/Typescript and React.
Badges
Installation
Install date-picker-typescript with npm
npm i date-picker-typescript
The datepicker already come with an input.
In order to work it need two variables:
- yearRange : Use to select the range of years you want for your date picker
- returnDate : a fonction to catch the date return by the datepicker
Here is the barebone way for it to work :
const [dateOfBirth, setDateOfBirth] = useState<string>("")
const handleReturnDateBirth = (date: string) => {
setDateOfBirth(date)
}
<DatePicker
yearRange={{ start: 1960, end: 2005 }}
returnDate={handleReturnDateBirth}
/>