React-Calendar
Install
npm i ciqu-react-calendar
OR
yarn add ciqu-react-calendar
Example
Component { superprops thisstate = value: } { console this } { console } { return false } { const onChange onOpenChange disabledDate = this return <div> <Calendar onChange=onChange value=thisstatevalue allowClear=true disabled=false placeholder='please input date' format='YYYY-MM-DD' onOpenChange=onOpenChange disabledDate=disabledDate /> </div> } ReactDom
API
interface CalendarProps // when input value changes, this callback will be called, default null onChange?value?: Moment inputValue?: string: void // fired when datepicker shows or hides, default null onOpenChange?status?: boolean: void // when returned true, the target date cannot be picked, default null disabledDate?currentDate: Moment inputValue: string: boolean // allow to clear the picked date, default true allowClear?: boolean // if true, datepicker is disabled, default false disabled?: boolean // control whether datepicker shows or hides, default false open?: boolean placeholder?: string // moment format string, default 'YYYY-MM-DD' format?: string className?: string // the value under control, default moment() value?: Moment // the default value defaultValue?: Moment
License
MIT