Calendar 日历
Calendar selector component
Install
$ npm install rax-calendar --save
Import
import Calendar from 'rax-calendar';
Props
name | type | default | describe |
---|---|---|---|
startDate | String | '' | optional start time |
endDate | String | '' | optional end time |
titleFormat | String | MMMM YYYY | month rendering format |
dateFormat | String | YYYY-MM-DD | return date format |
weekStart | Num | 1 | start the date as a week |
prevButtonText | String | '' | display text for month switch button |
nextButtonText | String | '' | display text for month switch button |
onDateSelect | Function | '' | select a date |
onTouchPrev | Function | '' | last month |
onTouchNext | Function | '' | next month |
Example
// demoimport createElement render Component from 'rax';import Calendar from 'rax-calendar';import View from 'rax-view'; state = selectedDate: '2017-01-01' { console; return <View> <Calendar ="calendar" = = = = = = = = = = /> </View> ; } ;