extensions of yearPicker and seasonPicker to rc-calendar
$ npm install rc-calendar-extend --save
- 引用(详细例子参考examples/index.js)
//开发环境
>cd examples
>npm run dev
//正式环境
>npm run build
>cd examples
>npm run build
>npm start
import { YearCalendar, SeasonCalendar, DatePicker, zhCN, enUS } from 'rc-calendar-extend'
render() {
const calendar = <YearCalendar locale={zhCN} style={{ zIndex: 1000, height: '310px' }} />
const Scalendar = <SeasonCalendar locale={zhCN} style={{ zIndex: 1000, height: '310px' }} />
return (
<div>
<DatePicker
animation='slide-up'
disabled={false}
calendar={calendar}
value={this.state.year}
onChange={this.onChange.bind(this, 'year')}
>
{
({ value }) => {
return (<input
style={{ width: 200 }}
readOnly
disabled={false}
value={value && value.format(format['year'])}
placeholder='请选择年份'
/>)
}
}
</DatePicker>
<DatePicker
animation='slide-up'
disabled={false}
calendar={Scalendar}
value={this.state.season}
onChange={this.onChange.bind(this, 'season')}
>
{
({ value }) => {
return (<input
style={{ width: 200 }}
readOnly
disabled={false}
value={value && value.format(format['season'])}
placeholder='请选择季度'
/>)
}
}
</DatePicker>
</div>
)
}