From 30cca548c245022a8d4dc5a13fb417a7209e058d Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Thu, 20 Jun 2024 23:06:10 +0200 Subject: [PATCH] Prepare next session --- .../accommodations/AccommodationsReservationsRoute.tsx | 8 +++++++- geneit_app/src/utils/time_utils.ts | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/geneit_app/src/routes/family/accommodations/AccommodationsReservationsRoute.tsx b/geneit_app/src/routes/family/accommodations/AccommodationsReservationsRoute.tsx index b47e03b..2d7bfc2 100644 --- a/geneit_app/src/routes/family/accommodations/AccommodationsReservationsRoute.tsx +++ b/geneit_app/src/routes/family/accommodations/AccommodationsReservationsRoute.tsx @@ -1,4 +1,4 @@ -import { DateSelectArg } from "@fullcalendar/core"; +import { DateSelectArg, EventClickArg } from "@fullcalendar/core"; import frLocale from "@fullcalendar/core/locales/fr"; import dayGridPlugin from "@fullcalendar/daygrid"; import interactionPlugin from "@fullcalendar/interaction"; @@ -27,6 +27,7 @@ import { AsyncWidget } from "../../../widgets/AsyncWidget"; import { useFamily } from "../../../widgets/BaseFamilyRoute"; import { FamilyPageTitle } from "../../../widgets/FamilyPageTitle"; import { useAccommodations } from "../../../widgets/accommodations/BaseAccommodationsRoute"; +import { EventImpl } from "@fullcalendar/core/internal"; export function AccommodationsReservationsRoute(): React.ReactElement { const snackbar = useSnackbar(); @@ -112,6 +113,10 @@ export function AccommodationsReservationsRoute(): React.ReactElement { } }; + const onEventClick = (ev: EventClickArg) => { + console.log(ev); + }; + return ( <> @@ -245,6 +250,7 @@ export function AccommodationsReservationsRoute(): React.ReactElement { right: "dayGridMonth,dayGridWeek,dayGridDay,listWeek", }} select={onSelect} + eventClick={onEventClick} events={visibleReservations?.map((r) => { const a = accommodations.accommodations.get( r.accommodation_id diff --git a/geneit_app/src/utils/time_utils.ts b/geneit_app/src/utils/time_utils.ts index 8b22197..aacde37 100644 --- a/geneit_app/src/utils/time_utils.ts +++ b/geneit_app/src/utils/time_utils.ts @@ -27,6 +27,5 @@ export function fmtUnixDateFullCalendar( .toString(10) .padStart(2, "0")}`*/ - console.log(s, d); return s; }