From 19bf52182596146fb911196d8db7c9a708e94d45 Mon Sep 17 00:00:00 2001 From: inmake Date: Fri, 2 Aug 2024 19:13:13 +0500 Subject: [PATCH] upd --- client/.env | 4 +-- client/src/components/Calendar.tsx | 18 +++++++----- client/src/components/Card.tsx | 7 +++-- server/package.json | 2 ++ server/src/index.ts | 2 -- server/src/routes/app.ts | 12 -------- server/src/routes/scheduledSessions.ts | 38 ++++++++++++++++++++++++-- server/yarn.lock | 12 ++++++++ 8 files changed, 68 insertions(+), 27 deletions(-) delete mode 100644 server/src/routes/app.ts 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) => (