fix: rangePicker showTime disabled not work, close #5286 #5380

pull/5387/head
tangjinzhou 3 years ago
parent 5724c84fe7
commit ecab7f66d8

@ -421,8 +421,16 @@ function RangerPicker<DateType>() {
let values = newValue;
let startValue = getValue(values, 0);
let endValue = getValue(values, 1);
const { generateConfig, locale, picker, order, onCalendarChange, allowEmpty, onChange } =
props;
const {
generateConfig,
locale,
picker,
order,
onCalendarChange,
allowEmpty,
onChange,
showTime,
} = props;
// >>>>> Format start & end values
if (startValue && endValue && generateConfig.isAfter(startValue, endValue)) {
@ -436,7 +444,9 @@ function RangerPicker<DateType>() {
(picker !== 'week' &&
picker !== 'quarter' &&
picker !== 'time' &&
!isSameDate(generateConfig, startValue, endValue))
!(showTime
? isEqual(generateConfig, startValue, endValue)
: isSameDate(generateConfig, startValue, endValue)))
) {
// Clean up end date when start date is after end date
if (sourceIndex === 0) {

Loading…
Cancel
Save