Browse Source

fix `format` props of RangePicker

+ close #3808
pull/3831/head
RaoHai 8 years ago
parent
commit
d4269f8f30
  1. 6
      components/date-picker/RangePicker.tsx
  2. 7
      components/date-picker/demo/disabled-date.md
  3. 2
      components/date-picker/index.tsx

6
components/date-picker/RangePicker.tsx

@ -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}

7
components/date-picker/demo/disabled-date.md

@ -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
);
````

2
components/date-picker/index.tsx

@ -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,
});

Loading…
Cancel
Save