From 982b0285c9376c0883ad4f3b4b66a4894b054fcc Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 5 Nov 2023 16:02:51 +0800 Subject: [PATCH] chore: fix date picker --- web/src/components/kit/DatePicker.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/src/components/kit/DatePicker.tsx b/web/src/components/kit/DatePicker.tsx index 5964e7d4..69ef1b28 100644 --- a/web/src/components/kit/DatePicker.tsx +++ b/web/src/components/kit/DatePicker.tsx @@ -39,9 +39,8 @@ const DatePicker: React.FC = (props: DatePickerProps) => { }, [user.username]); const firstDate = new Date(currentDateStamp); - const firstDateDay = firstDate.getDay() === 0 ? 7 : firstDate.getDay(); const dayList = []; - for (let i = 1; i < firstDateDay; i++) { + for (let i = 0; i < firstDate.getDay(); i++) { dayList.push({ date: 0, datestamp: firstDate.getTime() - DAILY_TIMESTAMP * (7 - i),