mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-05 19:41:42 +08:00
fix(Calendar): range type defaultDate when set allowSameDay (#10971)
This commit is contained in:
parent
da3400435f
commit
35f81fb208
@ -134,7 +134,7 @@ export default defineComponent({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getInitialDate = (defaultDate = props.defaultDate) => {
|
const getInitialDate = (defaultDate = props.defaultDate) => {
|
||||||
const { type, minDate, maxDate } = props;
|
const { type, minDate, maxDate, allowSameDay } = props;
|
||||||
|
|
||||||
if (defaultDate === null) {
|
if (defaultDate === null) {
|
||||||
return defaultDate;
|
return defaultDate;
|
||||||
@ -151,7 +151,10 @@ export default defineComponent({
|
|||||||
minDate,
|
minDate,
|
||||||
getPrevDay(maxDate)
|
getPrevDay(maxDate)
|
||||||
);
|
);
|
||||||
const end = limitDateRange(defaultDate[1] || now, getNextDay(minDate));
|
const end = limitDateRange(
|
||||||
|
defaultDate[1] || now,
|
||||||
|
allowSameDay ? minDate : getNextDay(minDate)
|
||||||
|
);
|
||||||
return [start, end];
|
return [start, end];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user