Commit 982b0285 authored by Steven's avatar Steven

chore: fix date picker

parent 405fc2b4
...@@ -39,9 +39,8 @@ const DatePicker: React.FC<DatePickerProps> = (props: DatePickerProps) => { ...@@ -39,9 +39,8 @@ const DatePicker: React.FC<DatePickerProps> = (props: DatePickerProps) => {
}, [user.username]); }, [user.username]);
const firstDate = new Date(currentDateStamp); const firstDate = new Date(currentDateStamp);
const firstDateDay = firstDate.getDay() === 0 ? 7 : firstDate.getDay();
const dayList = []; const dayList = [];
for (let i = 1; i < firstDateDay; i++) { for (let i = 0; i < firstDate.getDay(); i++) {
dayList.push({ dayList.push({
date: 0, date: 0,
datestamp: firstDate.getTime() - DAILY_TIMESTAMP * (7 - i), datestamp: firstDate.getTime() - DAILY_TIMESTAMP * (7 - i),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment