From 35b199f9f6470cd0c96e7a63a3ed4db66e55487a Mon Sep 17 00:00:00 2001 From: johnsonwong666 <1067100250@qq.com> Date: Mon, 26 Jun 2023 16:00:43 +0800 Subject: [PATCH] fix(Calendar): fix startDay with range type and allow same day --- packages/calendar/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/calendar/index.ts b/packages/calendar/index.ts index 4033efce..ab3e16de 100644 --- a/packages/calendar/index.ts +++ b/packages/calendar/index.ts @@ -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()