fix format props of RangePicker

+ close #3808
This commit is contained in:
RaoHai 2016-11-14 11:56:05 +08:00
parent b0f366cb0f
commit d4269f8f30
3 changed files with 10 additions and 5 deletions

View File

@ -46,7 +46,10 @@ export default class RangePicker extends React.Component<any, any> {
render() {
const props = this.props;
const { disabledDate, disabledTime, showTime, prefixCls, popupStyle, style, onOk, locale } = props;
const { disabledDate, disabledTime, showTime,
prefixCls, popupStyle, style, onOk, locale,
format,
} = props;
const state = this.state;
const calendarClassName = classNames({
@ -74,6 +77,7 @@ export default class RangePicker extends React.Component<any, any> {
const calendar = (
<RangeCalendar
{...calendarHandler}
format={format}
prefixCls={prefixCls}
className={calendarClassName}
timePicker={props.timePicker}

View File

@ -57,7 +57,8 @@ ReactDOM.render(
<div>
<DatePicker format="YYYY-MM-DD HH:mm:ss" disabledDate={disabledDate} disabledTime={disabledDateTime} showTime />
<br />
<RangePicker format="YYYY-MM-DD HH:mm:ss" disabledDate={disabledDate} disabledTime={disabledRangeTime} showTime />
</div>
, mountNode);
<RangePicker disabledDate={disabledDate} disabledTime={disabledRangeTime} showTime={{ hideDisabledOptions: true }} />
</div>,
mountNode
);
````

View File

@ -55,7 +55,7 @@ export interface RangePickerProps extends PickerProps {
}
assign(DatePicker, {
RangePicker: wrapPicker(RangePicker),
RangePicker: wrapPicker(RangePicker, 'YYYY-MM-DD hh:mm:ss'),
Calendar,
MonthPicker,
});