Merge branch 'develop-1.0.0' of https://github.com/freestyle21/ant-design into freestyle21-develop-1.0.0

This commit is contained in:
afc163 2016-04-15 12:06:54 +08:00
commit 7fffcffdb2
2 changed files with 12 additions and 2 deletions

View File

@ -34,9 +34,9 @@ english: DatePicker
| popupStyle | 格外的弹出日历样式 | object | {} |
| size | 输入框大小,`large` 高度为 32px`small` 为 22px默认是 28px | string | 无 |
| locale | 国际化配置 | object | [默认配置](https://github.com/ant-design/ant-design/issues/424) |
| showTime | 增加时间选择功能 | bool | false |
| onOk | 点击确定按钮的回调 | function(Date value) | 无 |
| getCalendarContainer | 定义浮层的容器,默认为 body 上新建 div | function(trigger) | 无 |
| showTime | 增加时间选择功能 | object | [TimePicker Options](http://ant.design/components/time-picker/#api) |
### MonthPicker

View File

@ -94,12 +94,22 @@ export default function wrapPicker(Picker, defaultFormat) {
});
const locale = this.getLocale();
const timeFormat = props.showTime && props.showTime.format;
const rcTimePickerProps = {
formatter: new DateTimeFormat(timeFormat || 'HH:mm:ss'),
showSecond: timeFormat && timeFormat.indexOf('ss') >= 0,
showHour: timeFormat && timeFormat.indexOf('HH') >= 0
};
const timePicker = props.showTime ? (
<TimePicker
{...props.showTime}
{...rcTimePickerProps}
prefixCls="ant-time-picker"
placeholder={locale.timePickerLocale.placeholder}
locale={locale.timePickerLocale}
transitionName="slide-up" />
transitionName="slide-up"
/>
) : null;
return (