reactdatepicker
v2.2.0
Published
a react component to choose date
Downloads
78
Readme
reactdatepicker
a react component to choose date
快速使用
npm install reactdatepicker
how to use it
import DatePicker from 'reactdatepicker';
class Demo extends React.Component{
handleSelect=()=>{}
handleCancel=(value)=>{
console.log(value);
}
render(){
return(
<DatePicker onSelect={this.handleSelect} onCancel={this.handleCancel}/>
)
}
}
props
| props name | description | example value | | :--------: | :-----: | :----: | | isOpen | handle the component is show or hide | true(type Boolean) | | min | Minimum date to choose | new Date(1992,0,1) | | max | The maximum date you can choose | new Date(2050,0,1) | | dateFormat | Format of formatted date | ['YYYY', 'MM', 'DD'], | | onSelect | function | ()=>{} | | onCancel | function | ()=>{} |