Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
✨ Accept wall-clock datetimes in API poll slot times (#2763)
Luke Vella82e45020a0a1
diff --git a/apps/web/src/app/api/private/examples.ts b/apps/web/src/app/api/private/examples.tsindex 87d86f9fd..873585f69 100644--- a/apps/web/src/app/api/private/examples.ts+++ b/apps/web/src/app/api/private/examples.ts@@ -18,7 +18,7 @@ export const createPollRequestExamples = {timePoll: {summary: "Time poll (explicit times)",description:- "Use `slots` with ISO datetime strings to offer specific time slots. Times are UTC and displayed to participants in the poll's `timezone`.",+ "Use `slots` with ISO datetime strings to offer specific time slots. Datetimes without an offset are interpreted as wall-clock in the poll's `timezone` — the example below offers 09:00 and 14:00 in London. Append `Z` or an offset to specify an absolute instant instead.",value: {title: "Project kickoff",location: "Zoom",@@ -26,9 +26,9 @@ export const createPollRequestExamples = {duration: 60,timezone: "Europe/London",times: [- "2026-08-03T09:00:00Z",- "2026-08-03T14:00:00Z",- "2026-08-04T09:00:00Z",+ "2026-08-03T09:00:00",+ "2026-08-03T14:00:00",+ "2026-08-04T09:00:00",],},} satisfies CreatePollInput,@@ -65,7 +65,7 @@ export const createPollRequestExamples = {duration: 90,timezone: "Europe/Berlin",times: [- "2026-08-01T10:00:00Z",+ "2026-08-01T10:00:00",{startDate: "2026-08-03",endDate: "2026-08-05",diff --git a/apps/web/src/app/api/private/schemas.ts b/apps/web/src/app/api/private/schemas.tsindex 785dba9cc..2d980e9ad 100644--- a/apps/web/src/app/api/private/schemas.ts+++ b/apps/web/src/app/api/private/schemas.ts@@ -33,15 +33,16 @@ const slotsInputSchema = z}),timezone: timezoneSchema.optional().openapi({description:- "IANA timezone. If not provided, times will be stored as UTC and no timezone will be set on the poll (indicating floating times).",+ "IANA timezone. Datetime strings without an offset are interpreted in this timezone. If omitted, offset-less datetimes are treated as floating times (no timezone conversion) and the poll has no timezone set.",example: "Europe/London",}),times: z.array(z.union([- z.iso.datetime().openapi({- description: "ISO datetime start time",- example: "2025-01-15T09:00:00Z",+ z.iso.datetime({ local: true, offset: true }).openapi({+ description:+ "ISO datetime start time. Strings without an offset are interpreted as wall-clock in `timezone` (e.g. `2025-01-15T09:00:00` with `timezone: Europe/London` means 09:00 in London). Strings with an offset or `Z` are treated as absolute instants.",+ example: "2025-01-15T09:00:00",}),slotGeneratorSchema,]),