fix(Calendar): initial date incorrect (#8696)
* fix(Calendar): initial date incorrect * feat(Calendar): add getToday function in utils
This commit is contained in:
@@ -24,6 +24,7 @@ import {
|
||||
cloneDates,
|
||||
getPrevDay,
|
||||
getNextDay,
|
||||
getToday,
|
||||
compareDay,
|
||||
calcDateNum,
|
||||
compareMonth,
|
||||
@@ -88,13 +89,13 @@ export default defineComponent({
|
||||
minDate: {
|
||||
type: Date,
|
||||
validator: isDate,
|
||||
default: () => new Date(),
|
||||
default: getToday,
|
||||
},
|
||||
maxDate: {
|
||||
type: Date,
|
||||
validator: isDate,
|
||||
default: () => {
|
||||
const now = new Date();
|
||||
const now = getToday();
|
||||
return new Date(now.getFullYear(), now.getMonth() + 6, now.getDate());
|
||||
},
|
||||
},
|
||||
@@ -129,7 +130,7 @@ export default defineComponent({
|
||||
return defaultDate;
|
||||
}
|
||||
|
||||
const now = new Date();
|
||||
const now = getToday();
|
||||
|
||||
if (type === 'range') {
|
||||
if (!Array.isArray(defaultDate)) {
|
||||
|
||||
Reference in New Issue
Block a user