mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 14:13:37 +08:00
Fix date-picker onOk
This commit is contained in:
parent
e5108f6b00
commit
11f6582235
@ -15,8 +15,8 @@ export default React.createClass({
|
||||
endPlaceholder: '结束日期',
|
||||
transitionName: 'slide-up',
|
||||
popupStyle: {},
|
||||
onChange() {
|
||||
}, // onChange 可用于 Validator
|
||||
onChange() {},
|
||||
onOk() {},
|
||||
locale: {},
|
||||
align: {
|
||||
offset: [0, -9],
|
||||
@ -63,7 +63,7 @@ export default React.createClass({
|
||||
defaultCalendarValue.setTime(Date.now());
|
||||
|
||||
const { disabledDate, showTime, size, startPlaceholder, endPlaceholder,
|
||||
transitionName, disabled, popupStyle, align, style } = this.props;
|
||||
transitionName, disabled, popupStyle, align, style, onOk } = this.props;
|
||||
const state = this.state;
|
||||
|
||||
const timePicker = showTime
|
||||
@ -84,6 +84,7 @@ export default React.createClass({
|
||||
disabledDate={disabledDate}
|
||||
dateInputPlaceholder={[startPlaceholder, endPlaceholder]}
|
||||
locale={locale.lang}
|
||||
onOk={onOk}
|
||||
defaultValue={[defaultCalendarValue, defaultCalendarValue]}
|
||||
showClear />
|
||||
);
|
||||
|
@ -16,8 +16,8 @@ function createPicker(TheCalendar, defaultFormat) {
|
||||
format: defaultFormat || 'yyyy-MM-dd',
|
||||
transitionName: 'slide-up',
|
||||
popupStyle: {},
|
||||
onChange() {
|
||||
}, // onChange 可用于 Validator
|
||||
onChange() {},
|
||||
onOk() {},
|
||||
locale: {},
|
||||
align: {
|
||||
offset: [0, -9],
|
||||
@ -81,6 +81,7 @@ function createPicker(TheCalendar, defaultFormat) {
|
||||
prefixCls="ant-calendar"
|
||||
className={calendarClassName}
|
||||
showOk={this.props.showTime}
|
||||
onOk={this.props.onOk}
|
||||
showClear />
|
||||
);
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
| size | 输入框大小,`large` 高度为 32px,`small` 为 22px,默认是 28px | string | 无 |
|
||||
| locale | 国际化配置 | object | [默认配置](https://github.com/ant-design/ant-design/issues/424) |
|
||||
| showTime | 增加时间选择功能 | bool | false |
|
||||
| onOk | 点击确定按钮的回调 | function | 无 |
|
||||
| onOk | 点击确定按钮的回调 | function(Date value) | 无 |
|
||||
|
||||
### RangePicker
|
||||
|
||||
@ -46,6 +46,7 @@
|
||||
| defaultValue | 默认日期 | [string|Date, string|Date] | 无 |
|
||||
| format | 展示的日期格式 | string | "yyyy-MM-dd HH:mm:ss" |
|
||||
| onChange | 时间发生变化的回调,发生在用户选择时间时 | function([Date start, Date end]) | 无 |
|
||||
| onOk | 点击确定按钮的回调 | function(Date value) | 无 |
|
||||
|
||||
`disabled` `style` `popupStyle` `size` `locale` `showTime` `onOk` 属性与 DatePicker 的一致。
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user