[fix] end isnt sent when none is selected

This commit is contained in:
Camille Moussu
2025-07-23 12:25:06 +02:00
parent a150db82cd
commit a5e326b5ac
+3 -3
View File
@@ -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],