diff --git a/pages/api/cancel.ts b/pages/api/cancel.ts index 3b879272be..bbaa775e9a 100644 --- a/pages/api/cancel.ts +++ b/pages/api/cancel.ts @@ -1,5 +1,6 @@ import { BookingStatus } from "@prisma/client"; import async from "async"; +import dayjs from "dayjs"; import { NextApiRequest, NextApiResponse } from "next"; import { refund } from "@ee/lib/stripe/server"; @@ -98,8 +99,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) title: bookingToDelete?.title, type: bookingToDelete?.eventType?.title as string, description: bookingToDelete?.description || "", - startTime: bookingToDelete?.startTime.toISOString(), - endTime: bookingToDelete?.endTime.toISOString(), + startTime: bookingToDelete?.startTime ? dayjs(bookingToDelete.startTime).format() : "", + endTime: bookingToDelete?.endTime ? dayjs(bookingToDelete.endTime).format() : "", organizer: { email: organizer.email, name: organizer.name ?? "Nameless",