Skip to content

mistyjae/rc-calendar-extend

Repository files navigation

rc-calendar-extend

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>
   )
}

About

yearPicker and seasonPicker extensions to rc-calendar

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published