fix: use UTC parsing for recurring booking dates to prevent timezone conversion issues (#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.
This commit is contained in:
1 parent
9f277c5179
commit
26e8582302
1 file changed
+4
-4
@@ -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>
|
||||
))}
|
||||
|
||||
Reference in new issue
Block a user