1.0.38 • Published 2 years ago
react-alldate-picker v1.0.38
A date picker for your React app.
✨ Features
- Pick days, months, years, or even decades
- No moment.js/day,js needed
📦Install
npm react-alldate-picker
🔨Usage
import React, { useState } from "react";
import { DatePicker } from "react-alldate-picker";
const Test = () => {
const [value, setValue] = useState(new Date())
const handleOnChange = (timestamp) => {
console.log("timestamp", timestamp)
}
return (
<div>
<DatePicker
onChange={handleOnChange}
value={value}
/>
</div>
)
}
export default Test
User guide
DatePicker
Props
Prop name | Description | Default value | Example values |
---|---|---|---|
onChange | Function called when the user picks a valid date. | n/a | (timestamp) => console.log(timestamp) |
minDate | Minimum date that the user can select. Periods partially overlapped by minDate will also be selectable. | new Date("0001-01-01") | Date: new Date() |
maxDate | Maximum date that the user can select. Periods partially overlapped by maxDate will also be selectable. | new Date("9999-12-31") | Date: new Date() |
value | Input value. | n/a | Date: new Date(2023, 12, 08) |
icon | Content of the calendar button. Setting the value explicitly to null will hide the icon. | (default icon) | React element: |
footer | footer of the calendar. Setting the value explicitly to null will hide the footer. | (default footer) | React element: |
onClose | Function called when the user closed the picker. | n/a | () => console.log("onClose") |
placeholder | placeholder for the day input. | "selecte date" | "select" |
1.0.38
2 years ago
1.0.33
2 years ago
1.0.37
2 years ago
1.0.36
2 years ago
1.0.35
2 years ago
1.0.34
2 years ago
1.0.29
2 years ago
1.0.32
2 years ago
1.0.31
2 years ago
1.0.30
2 years ago
1.0.26
2 years ago
1.0.25
2 years ago
1.0.24
2 years ago
1.0.23
2 years ago
1.0.28
2 years ago
1.0.27
2 years ago
1.0.19
2 years ago
1.0.22
2 years ago
1.0.21
2 years ago
1.0.20
2 years ago
1.0.18
2 years ago
1.0.17
2 years ago
1.0.16
2 years ago
1.0.15
2 years ago
1.0.14
2 years ago
1.0.13
2 years ago
1.0.12
2 years ago
1.0.11
2 years ago
1.0.10
2 years ago
1.0.9
2 years ago
1.0.8
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago