diff --git a/components/date-picker/RangePicker.jsx b/components/date-picker/RangePicker.jsx index 0d5bab5266..1b0571fd51 100644 --- a/components/date-picker/RangePicker.jsx +++ b/components/date-picker/RangePicker.jsx @@ -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 /> ); diff --git a/components/date-picker/index.jsx b/components/date-picker/index.jsx index cbabbc9205..e7ff674d56 100644 --- a/components/date-picker/index.jsx +++ b/components/date-picker/index.jsx @@ -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 /> ); diff --git a/components/date-picker/index.md b/components/date-picker/index.md index 61f953b8a0..c88c46ef6f 100644 --- a/components/date-picker/index.md +++ b/components/date-picker/index.md @@ -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 的一致。