mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 03:59:01 +08:00
change timepicker options to rctimepicker options
This commit is contained in:
parent
a674657287
commit
6b3a97b902
@ -13,6 +13,6 @@ function onChange(value) {
|
||||
}
|
||||
|
||||
ReactDOM.render(
|
||||
<DatePicker showTime format="yyyy-MM-dd HH:mm:ss" placeholder="请选择时间" onChange={onChange} />
|
||||
<DatePicker showTime={{format:'HH:mm'}} format="yyyy-MM-dd HH:mm:ss" placeholder="请选择时间" onChange={onChange} />
|
||||
, mountNode);
|
||||
````
|
||||
|
@ -95,6 +95,12 @@ 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
|
||||
prefixCls="ant-time-picker"
|
||||
@ -102,9 +108,13 @@ export default function wrapPicker(Picker, defaultFormat) {
|
||||
locale={locale.timePickerLocale}
|
||||
transitionName="slide-up"
|
||||
{...props.showTime}
|
||||
{...rcTimePickerProps}
|
||||
/>
|
||||
) : null;
|
||||
|
||||
console.log(timePicker)
|
||||
console.log('....')
|
||||
|
||||
return (
|
||||
<Picker
|
||||
{...this.props}
|
||||
|
Loading…
Reference in New Issue
Block a user