Skip to content

Scheduling infrastructure for absolutely everyone.

fix: use UTC parsing for recurring booking dates to prevent timezone conversion issues (#25235)

chauhan_s26e8582302bb
diff --git a/apps/web/modules/bookings/views/bookings-single-view.tsx b/apps/web/modules/bookings/views/bookings-single-view.tsx
index 6c3c35e8de4..fc0156d4ec5 100644
--- a/apps/web/modules/bookings/views/bookings-single-view.tsx
+++ b/apps/web/modules/bookings/views/bookings-single-view.tsx
@@ -1207,7 +1207,7 @@ function RecurringBookings({
{eventType.recurringEvent?.count &&
recurringBookingsSorted.slice(0, 4).map((dateStr: string, idx: number) => (
<div key={idx} className={classNames("mb-2", isCancelled ? "line-through" : "")}>
- {formatToLocalizedDate(dayjs.tz(dateStr, tz), language, "full", tz)}
+ {formatToLocalizedDate(dayjs.utc(dateStr), language, "full", tz)}
<br />
{formatToLocalizedTime({
date: dayjs(dateStr),
@@ -1225,7 +1225,7 @@ function RecurringBookings({
timeZone: tz,
})}{" "}
<span className="text-bookinglight">
- ({formatToLocalizedTimezone(dayjs(dateStr), language, tz)})
+ ({formatToLocalizedTimezone(dayjs.utc(dateStr), language, tz)})
</span>
</div>
))}
@@ -1240,7 +1240,7 @@ function RecurringBookings({
{eventType.recurringEvent?.count &&
recurringBookingsSorted.slice(4).map((dateStr: string, idx: number) => (
<div key={idx} className={classNames("mb-2", isCancelled ? "line-through" : "")}>
- {formatToLocalizedDate(dayjs.tz(dateStr, tz), language, "full", tz)}
+ {formatToLocalizedDate(dayjs.utc(dateStr), language, "full", tz)}
<br />
{formatToLocalizedTime({
date: dayjs(dateStr),
@@ -1256,7 +1256,7 @@ function RecurringBookings({
timeZone: tz,
})}{" "}
<span className="text-bookinglight">
- ({formatToLocalizedTimezone(dayjs(dateStr), language, tz)})
+ ({formatToLocalizedTimezone(dayjs.utc(dateStr), language, tz)})
</span>
</div>
))}