diff --git a/components/date-picker/PickerMixin.jsx b/components/date-picker/PickerMixin.jsx index 9951fa9858..ca6c750480 100644 --- a/components/date-picker/PickerMixin.jsx +++ b/components/date-picker/PickerMixin.jsx @@ -13,7 +13,11 @@ export default { getFormatter() { const formats = this.formats = this.formats || {}; - const format = this.props.format; + let format = this.props.format; + // Remove time format text when has time-picker in calendar + if (this.props.showTime) { + format = format.replace('HH:mm:ss', ''); + } if (formats[format]) { return formats[format]; } diff --git a/components/date-picker/demo/with-time-picker.md b/components/date-picker/demo/with-time-picker.md index 6e5f73dde0..0aab63a50e 100644 --- a/components/date-picker/demo/with-time-picker.md +++ b/components/date-picker/demo/with-time-picker.md @@ -3,7 +3,7 @@ - order: 4 - hidden: true -和 [时间选择框](/components/timepicer) 配合使用。 +和 [时间选择框](/components/time-picker) 配合使用。 --- diff --git a/components/date-picker/index.jsx b/components/date-picker/index.jsx index f44698aea1..cbabbc9205 100644 --- a/components/date-picker/index.jsx +++ b/components/date-picker/index.jsx @@ -62,6 +62,8 @@ function createPicker(TheCalendar, defaultFormat) { transitionName="slide-up" /> : null; + const disabledTime = this.props.showTime ? this.props.disabledTime : null; + const calendarClassName = classNames({ ['ant-calendar-time']: this.props.showTime, ['ant-calendar-month']: MonthCalendar === TheCalendar, @@ -71,6 +73,7 @@ function createPicker(TheCalendar, defaultFormat) {