WeekPicker: support renderExtraFooter

This commit is contained in:
HarlanLuo 2018-12-24 14:59:05 +08:00 committed by 偏右
parent 015945ed83
commit a7bedca0e2
3 changed files with 10 additions and 0 deletions

View File

@ -100,6 +100,13 @@ class WeekPicker extends React.Component<any, WeekPickerState> {
this.handleChange(null);
};
renderFooter = (...args: any[]) => {
const { prefixCls, renderExtraFooter } = this.props;
return renderExtraFooter ? (
<div className={`${prefixCls}-footer-extra`}>{renderExtraFooter(...args)}</div>
) : null;
};
focus() {
this.input.focus();
}
@ -157,6 +164,7 @@ class WeekPicker extends React.Component<any, WeekPickerState> {
showDateInput={false}
showToday={false}
disabledDate={disabledDate}
renderFooter={this.renderFooter}
/>
);
const clearIcon =

View File

@ -111,6 +111,7 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker, WeekPicke
| format | to set the date format, refer to [moment.js](http://momentjs.com/) | string | "YYYY-wo" |
| value | to set date | [moment](http://momentjs.com/) | - |
| onChange | a callback function, can be executed when the selected time is changing | function(date: moment, dateString: string) | - |
| renderExtraFooter | render extra footer in panel | (mode) => React.ReactNode | - |
### RangePicker

View File

@ -114,6 +114,7 @@ moment.locale('zh-cn');
| format | 展示的日期格式,配置参考 [moment.js](http://momentjs.com/) | string | "YYYY-wo" |
| value | 日期 | [moment](http://momentjs.com/) | - |
| onChange | 时间发生变化的回调,发生在用户选择时间时 | function(date: moment, dateString: string) | - |
| renderExtraFooter | 在面板中添加额外的页脚 | (mode) => React.ReactNode | - |
### RangePicker