fix format props of RangePicker (#3831)

+ close #3808
This commit is contained in:
偏右 2016-11-15 14:03:20 +08:00 committed by GitHub
commit 1ae4816cd0
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,
});