Adjust booking list startTime to the timeZone of the logged in user (#4984)

pull/4987/head
Alex van Andel 2022-10-13 12:01:11 +01:00 committed by GitHub
parent f949cf1bd1
commit a28325e69a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 4 deletions

View File

@ -257,8 +257,13 @@ function BookingListItem(booking: BookingItemProps) {
<div className="cursor-pointer py-4">
<div className="text-sm leading-6 text-gray-900">{startTime}</div>
<div className="text-sm text-gray-500">
{dayjs(booking.startTime).format(user && user.timeFormat === 12 ? "h:mma" : "HH:mm")} -{" "}
{dayjs(booking.endTime).format(user && user.timeFormat === 12 ? "h:mma" : "HH:mm")}
{dayjs(booking.startTime)
.tz(user?.timeZone)
.format(user && user.timeFormat === 12 ? "h:mma" : "HH:mm")}{" "}
-{" "}
{dayjs(booking.endTime)
.tz(user?.timeZone)
.format(user && user.timeFormat === 12 ? "h:mma" : "HH:mm")}
</div>
{isPending && (
@ -293,8 +298,13 @@ function BookingListItem(booking: BookingItemProps) {
<div className="flex w-full items-center justify-between sm:hidden">
<div className="text-sm leading-6 text-gray-900">{startTime}</div>
<div className="pr-2 text-sm text-gray-500">
{dayjs(booking.startTime).format(user && user.timeFormat === 12 ? "h:mma" : "HH:mm")} -{" "}
{dayjs(booking.endTime).format(user && user.timeFormat === 12 ? "h:mma" : "HH:mm")}
{dayjs(booking.startTime)
.tz(user?.timeZone)
.format(user && user.timeFormat === 12 ? "h:mma" : "HH:mm")}{" "}
-{" "}
{dayjs(booking.endTime)
.tz(user?.timeZone)
.format(user && user.timeFormat === 12 ? "h:mma" : "HH:mm")}
</div>
</div>