Merge pull request #5456 from johnsonwong666/hotfix/fix_issue_5451

fix(Calendar): fix startDay with range type and allow same day
This commit is contained in:
landluck 2023-07-03 15:09:23 +08:00 committed by GitHub
commit a232ec525f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -211,14 +211,14 @@ VantComponent({
const [startDay, endDay] = defaultDate || [];
const startDate = getTime(startDay || now);
const start = this.limitDateRange(
startDay || now,
startDate,
minDate,
getPrevDay(new Date(maxDate)).getTime()
allowSameDay ? startDate : getPrevDay(new Date(maxDate)).getTime()
);
const date = getTime(endDay || now);
const end = this.limitDateRange(
date,
allowSameDay ? date : getNextDay(new Date(minDate)).getTime()