Skip to content

Commit 26e8582

Browse files
authored
fix: use UTC parsing for recurring booking dates to prevent timezone conversion issues (calcom#25235)
Replace dayjs.tz() with dayjs.utc() when parsing recurring booking date strings to ensure dates are interpreted as UTC timestamps rather than being converted to the specified timezone. This prevents incorrect date/time display when the dateStr is already in UTC format.
1 parent 9f277c5 commit 26e8582

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

apps/web/modules/bookings/views/bookings-single-view.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ function RecurringBookings({
12071207
{eventType.recurringEvent?.count &&
12081208
recurringBookingsSorted.slice(0, 4).map((dateStr: string, idx: number) => (
12091209
<div key={idx} className={classNames("mb-2", isCancelled ? "line-through" : "")}>
1210-
{formatToLocalizedDate(dayjs.tz(dateStr, tz), language, "full", tz)}
1210+
{formatToLocalizedDate(dayjs.utc(dateStr), language, "full", tz)}
12111211
<br />
12121212
{formatToLocalizedTime({
12131213
date: dayjs(dateStr),
@@ -1225,7 +1225,7 @@ function RecurringBookings({
12251225
timeZone: tz,
12261226
})}{" "}
12271227
<span className="text-bookinglight">
1228-
({formatToLocalizedTimezone(dayjs(dateStr), language, tz)})
1228+
({formatToLocalizedTimezone(dayjs.utc(dateStr), language, tz)})
12291229
</span>
12301230
</div>
12311231
))}
@@ -1240,7 +1240,7 @@ function RecurringBookings({
12401240
{eventType.recurringEvent?.count &&
12411241
recurringBookingsSorted.slice(4).map((dateStr: string, idx: number) => (
12421242
<div key={idx} className={classNames("mb-2", isCancelled ? "line-through" : "")}>
1243-
{formatToLocalizedDate(dayjs.tz(dateStr, tz), language, "full", tz)}
1243+
{formatToLocalizedDate(dayjs.utc(dateStr), language, "full", tz)}
12441244
<br />
12451245
{formatToLocalizedTime({
12461246
date: dayjs(dateStr),
@@ -1256,7 +1256,7 @@ function RecurringBookings({
12561256
timeZone: tz,
12571257
})}{" "}
12581258
<span className="text-bookinglight">
1259-
({formatToLocalizedTimezone(dayjs(dateStr), language, tz)})
1259+
({formatToLocalizedTimezone(dayjs.utc(dateStr), language, tz)})
12601260
</span>
12611261
</div>
12621262
))}

0 commit comments

Comments
 (0)