diff --git a/server/helper/dateHelper.ts b/server/helper/dateHelper.ts index 8fdab45..38c7ca0 100644 --- a/server/helper/dateHelper.ts +++ b/server/helper/dateHelper.ts @@ -4,14 +4,14 @@ import { GuildScheduledEvent } from "discord.js"; import { logger } from "../logger"; import de from "date-fns/locale/de"; -export function createDateStringFromEvent(event: GuildScheduledEvent, requestId: string, guildId?: string): string { - if (!event.scheduledStartAt) { +export function createDateStringFromEvent(eventStartDate:Date, requestId: string, guildId?: string): string { + if (!eventStartDate) { logger.error("Event has no start. Cannot create dateString.", { guildId, requestId }) return `"habe keinen Startzeitpunkt ermitteln können"` } const timeZone = 'Europe/Berlin' - const zonedDateTime = utcToZonedTime(event.scheduledStartAt, timeZone) + const zonedDateTime = utcToZonedTime(eventStartDate, timeZone) const time = format(zonedDateTime, "HH:mm", { locale: de }) if (isToday(zonedDateTime)) {