diff --git a/packages/trpc/lib/routers/hotels/schemas/hotel/specialAlerts.ts b/packages/trpc/lib/routers/hotels/schemas/hotel/specialAlerts.ts index 338964fd3..1485d0ac0 100644 --- a/packages/trpc/lib/routers/hotels/schemas/hotel/specialAlerts.ts +++ b/packages/trpc/lib/routers/hotels/schemas/hotel/specialAlerts.ts @@ -29,7 +29,7 @@ export const specialAlertsSchema = z text: alert.description || null, type: AlertTypeEnum.Info, displayInBookingFlow: alert.displayInBookingFlow, - endDate: dt.utc(alert.endDate).toISOString(), - startDate: dt.utc(alert.startDate).toISOString(), + endDate: alert.endDate ? dt.utc(alert.endDate).toISOString() : null, + startDate: alert.startDate ? dt.utc(alert.startDate).toISOString() : null, })) )