diff --git a/client/.env b/client/.env index 0038af3..57f426c 100644 --- a/client/.env +++ b/client/.env @@ -1,4 +1,4 @@ -# VITE_API_URL=http://localhost:3001 +VITE_API_URL=http://localhost:3001 # VITE_API_URL=http://192.168.1.171:3001 -VITE_API_URL=https://crm.stream.graff.tech/api +# VITE_API_URL=https://crm.stream.graff.tech/api VITE_STREAM_URL=https://stream.graff.tech diff --git a/client/src/components/Calendar.tsx b/client/src/components/Calendar.tsx index 7aef853..7ddd861 100644 --- a/client/src/components/Calendar.tsx +++ b/client/src/components/Calendar.tsx @@ -1,11 +1,13 @@ import { addMonths, format, + getDay, getDaysInMonth, - getISODay, isSameDay, isToday, setDate, + startOfDay, + startOfMonth, subMonths, } from "date-fns"; import { useState } from "react"; @@ -22,7 +24,9 @@ import useStore from "../stores/useStore"; function Calendar() { const { selectedDay, setSelectedDay } = useStore(); const { isShowCalendar, setIsShowCalendar } = useSettingsStore(); - const [currentMonth, setCurrentMonth] = useState(new Date()); + const [currentMonth, setCurrentMonth] = useState( + startOfMonth(startOfDay(new Date())) + ); function selectPrevMonth() { setCurrentMonth(subMonths(currentMonth, 1)); @@ -74,11 +78,11 @@ function Calendar() { ))}
- {Array.from({ length: getISODay(currentMonth) - 1 }).map( - (_, index) => ( -
- ) - )} + {Array.from({ + length: getDay(startOfDay(startOfMonth(currentMonth))) - 1, + }).map((_, index) => ( +
+ ))} {Array.from({ length: getDaysInMonth(currentMonth) }).map( (_, index) => (