From a5e326b5acd4eae8b36974bf6e4ff2fabde26307 Mon Sep 17 00:00:00 2001 From: Camille Moussu Date: Wed, 23 Jul 2025 12:25:06 +0200 Subject: [PATCH] [fix] end isnt sent when none is selected --- src/features/Events/EventModal.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/features/Events/EventModal.tsx b/src/features/Events/EventModal.tsx index cbfa46a..7d12cd4 100644 --- a/src/features/Events/EventModal.tsx +++ b/src/features/Events/EventModal.tsx @@ -60,7 +60,6 @@ function EventPopover({ useEffect(() => { if (selectedRange) { setStart(selectedRange ? formatLocalDateTime(selectedRange.start) : ""); - setEnd(selectedRange ? formatLocalDateTime(selectedRange.end) : ""); } }, [selectedRange]); @@ -68,7 +67,6 @@ function EventPopover({ const newEvent: CalendarEvent = { title, start: new Date(start), - end: new Date(end), allday, uid: crypto.randomUUID(), description, @@ -89,7 +87,9 @@ function EventPopover({ transp: "OPAQUE", color: userPersonnalCalendars[calendarid]?.color, }; - + if (end) { + newEvent.end = new Date(end); + } dispatch( putEventAsync({ cal: userPersonnalCalendars[calendarid],