Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🐛 Set correct end date for all day events (#1926)

Luke Vella08ffdae2c2f2
diff --git a/apps/web/src/trpc/routers/polls.ts b/apps/web/src/trpc/routers/polls.ts
index 55fbbde0a..0c212fd01 100644
--- a/apps/web/src/trpc/routers/polls.ts
+++ b/apps/web/src/trpc/routers/polls.ts
@@ -847,7 +847,10 @@ export const polls = router({
id: eventId,
uid: `${eventId}@rallly.co`,
start: eventStart.toDate(),
- end: eventStart.add(option.duration, "minute").toDate(),
+ end:
+ option.duration > 0
+ ? eventStart.add(option.duration, "minute").toDate()
+ : eventStart.add(1, "day").toDate(),
title: poll.title,
location: poll.location,
timeZone: poll.timeZone,