Browse Source

Fix date-picker onOk

pull/986/head
afc163 9 years ago
parent
commit
11f6582235
  1. 7
      components/date-picker/RangePicker.jsx
  2. 5
      components/date-picker/index.jsx
  3. 3
      components/date-picker/index.md

7
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 />
);

5
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 />
);

3
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 的一致。

Loading…
Cancel
Save