From dfecb33236cfb96d5c514c0d0eb175e2d8159852 Mon Sep 17 00:00:00 2001 From: lenhanphung Date: Fri, 19 Sep 2025 14:38:08 +0700 Subject: [PATCH] Fix: prettier Feat: main grid start at current time --- src/components/Calendar/Calendar.tsx | 7 +++++-- src/components/Calendar/CalendarSelection.tsx | 3 ++- src/features/Events/EventModal.tsx | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/Calendar/Calendar.tsx b/src/components/Calendar/Calendar.tsx index 58d0c66..771218b 100644 --- a/src/components/Calendar/Calendar.tsx +++ b/src/components/Calendar/Calendar.tsx @@ -56,7 +56,8 @@ export default function CalendarApp() { const calendars = useAppSelector((state) => state.calendars.list); const pending = useAppSelector((state) => state.calendars.pending); - const userId = useAppSelector((state) => state.user.userData?.openpaasId) ?? ""; + const userId = + useAppSelector((state) => state.user.userData?.openpaasId) ?? ""; const selectPersonnalCalendars = createSelector( (state) => state.calendars, (calendars) => @@ -317,7 +318,9 @@ export default function CalendarApp() { weekNumberFormat={{ week: "long" }} slotDuration={"00:30:00"} slotLabelInterval={"00:30:00"} - scrollTime={"08:00:00"} + scrollTime={new Date(Date.now() - 2 * 60 * 60 * 1000) + .toTimeString() + .slice(0, 5)} unselectAuto={false} allDayText="" slotLabelFormat={{ diff --git a/src/components/Calendar/CalendarSelection.tsx b/src/components/Calendar/CalendarSelection.tsx index 4d78dae..1734226 100644 --- a/src/components/Calendar/CalendarSelection.tsx +++ b/src/components/Calendar/CalendarSelection.tsx @@ -80,7 +80,8 @@ export default function CalendarSelection({ selectedCalendars: string[]; setSelectedCalendars: Function; }) { - const userId = useAppSelector((state) => state.user.userData?.openpaasId) ?? ""; + const userId = + useAppSelector((state) => state.user.userData?.openpaasId) ?? ""; const calendars = useAppSelector((state) => state.calendars.list); const personnalCalendars = Object.keys(calendars).filter( diff --git a/src/features/Events/EventModal.tsx b/src/features/Events/EventModal.tsx index 2bc80ed..d55cb9c 100644 --- a/src/features/Events/EventModal.tsx +++ b/src/features/Events/EventModal.tsx @@ -46,7 +46,8 @@ function EventPopover({ const dispatch = useAppDispatch(); const organizer = useAppSelector((state) => state.user.organiserData); - const userId = useAppSelector((state) => state.user.userData?.openpaasId) ?? ""; + const userId = + useAppSelector((state) => state.user.userData?.openpaasId) ?? ""; const selectPersonnalCalendars = createSelector( (state) => state.calendars, (calendars) =>