-
Notifications
You must be signed in to change notification settings - Fork 12k
fix: Cal Video sidebar not showing meeting time in timezone #22821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1229,8 +1229,21 @@ function RecurringBookings({ | |
| <div key={idx} className={classNames("mb-2", isCancelled ? "line-through" : "")}> | ||
| {formatToLocalizedDate(dayjs.tz(dateStr, tz), language, "full", tz)} | ||
| <br /> | ||
| {formatToLocalizedTime(dayjs(dateStr), language, undefined, !is24h, tz)} -{" "} | ||
| {formatToLocalizedTime(dayjs(dateStr).add(duration, "m"), language, undefined, !is24h, tz)}{" "} | ||
| {formatToLocalizedTime({ | ||
| date: dayjs(dateStr), | ||
| locale: language, | ||
| timeStyle: undefined, | ||
| hour12: !is24h, | ||
| timeZone: tz, | ||
| })}{" "} | ||
| -{" "} | ||
| {formatToLocalizedTime({ | ||
| date: dayjs(dateStr).add(duration, "m"), | ||
| locale: language, | ||
| timeStyle: undefined, | ||
| hour12: !is24h, | ||
| timeZone: tz, | ||
| })}{" "} | ||
| <span className="text-bookinglight"> | ||
| ({formatToLocalizedTimezone(dayjs(dateStr), language, tz)}) | ||
| </span> | ||
|
|
@@ -1249,14 +1262,19 @@ function RecurringBookings({ | |
| <div key={idx} className={classNames("mb-2", isCancelled ? "line-through" : "")}> | ||
| {formatToLocalizedDate(dayjs.tz(dateStr, tz), language, "full", tz)} | ||
| <br /> | ||
| {formatToLocalizedTime(dayjs(dateStr), language, undefined, !is24h, tz)} -{" "} | ||
| {formatToLocalizedTime( | ||
| dayjs(dateStr).add(duration, "m"), | ||
| language, | ||
| undefined, | ||
| !is24h, | ||
| tz | ||
| )}{" "} | ||
| {formatToLocalizedTime({ | ||
| date: dayjs(dateStr), | ||
| locale: language, | ||
| hour12: !is24h, | ||
| timeZone: tz, | ||
| })}{" "} | ||
| -{" "} | ||
| {formatToLocalizedTime({ | ||
| date: dayjs(dateStr).add(duration, "m"), | ||
| locale: language, | ||
| hour12: !is24h, | ||
| timeZone: tz, | ||
| })}{" "} | ||
|
Comment on lines
+1265
to
+1277
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: It might be better to have a fn that does returns this time range. It seems to be a duplicate here. Same as above. |
||
| <span className="text-bookinglight"> | ||
| ({formatToLocalizedTimezone(dayjs(dateStr), language, tz)}) | ||
| </span> | ||
|
|
@@ -1273,8 +1291,13 @@ function RecurringBookings({ | |
| <div className={classNames(isCancelled ? "line-through" : "")}> | ||
| {formatToLocalizedDate(date, language, "full", tz)} | ||
| <br /> | ||
| {formatToLocalizedTime(date, language, undefined, !is24h, tz)} -{" "} | ||
| {formatToLocalizedTime(dayjs(date).add(duration, "m"), language, undefined, !is24h, tz)}{" "} | ||
| {formatToLocalizedTime({ date, locale: language, hour12: !is24h, timeZone: tz })} -{" "} | ||
| {formatToLocalizedTime({ | ||
| date: dayjs(date).add(duration, "m"), | ||
| locale: language, | ||
| hour12: !is24h, | ||
| timeZone: tz, | ||
| })}{" "} | ||
|
Comment on lines
+1294
to
+1300
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one too is duplicate it seems |
||
| <span className="text-bookinglight">({formatToLocalizedTimezone(date, language, tz)})</span> | ||
| </div> | ||
| ); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -288,6 +288,7 @@ export function VideoMeetingInfo(props: VideoMeetingInfo) { | |
|
|
||
| const endTime = new Date(booking.endTime); | ||
| const startTime = new Date(booking.startTime); | ||
| const timeZone = booking.user?.timeZone; | ||
|
|
||
| useDailyEvent("left-meeting", () => { | ||
| if (rediectAttendeeToOnExit) { | ||
|
|
@@ -306,11 +307,11 @@ export function VideoMeetingInfo(props: VideoMeetingInfo) { | |
| <h3>{t("what")}:</h3> | ||
| <p>{booking.title}</p> | ||
| <h3>{t("invitee_timezone")}:</h3> | ||
| <p>{booking.user?.timeZone}</p> | ||
| <p>{timeZone}</p> | ||
| <h3>{t("when")}:</h3> | ||
| <p suppressHydrationWarning={true}> | ||
| {formatToLocalizedDate(startTime)} <br /> | ||
| {formatToLocalizedTime(startTime)} | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Timezone wasn't being passed even though we're displaying it in the sidebar. |
||
| {formatToLocalizedTime({ date: startTime, timeZone })} | ||
| </p> | ||
| <h3>{t("time_left")}</h3> | ||
| <ProgressBar | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,13 +79,19 @@ export const formatToLocalizedDate = ( | |
| * given Date object and locale. Undefined values mean the defaults | ||
| * associated with the browser's current locale will be used. | ||
| */ | ||
| export const formatToLocalizedTime = ( | ||
| date: Date | Dayjs, | ||
| locale: string | undefined = undefined, | ||
| timeStyle: Intl.DateTimeFormatOptions["timeStyle"] = "short", | ||
| hour12: Intl.DateTimeFormatOptions["hour12"] = undefined, | ||
| timeZone?: string | ||
| ) => formatLocalizedDateTime(date, { timeStyle, hour12, timeZone }, locale); | ||
| export const formatToLocalizedTime = ({ | ||
| date, | ||
| locale = undefined, | ||
| timeStyle = "short", | ||
| hour12 = undefined, | ||
| timeZone, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it make sense to make timeZone a required field, so that goign forward this timeZone isn't accidentally missed |
||
| }: { | ||
| date: Date | Dayjs; | ||
| locale?: string | undefined; | ||
| timeStyle?: Intl.DateTimeFormatOptions["timeStyle"]; | ||
| hour12?: Intl.DateTimeFormatOptions["hour12"]; | ||
| timeZone?: string; | ||
| }) => formatLocalizedDateTime(date, { timeStyle, hour12, timeZone }, locale); | ||
|
|
||
| /** | ||
| * Returns a translated timezone based on the given Date object and | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're passing an object to
formatToLocalizedTimewe don't need to pass undefined as a param here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are still setting timeStyle to undefined in the new object argument format, I think we should have skipped that.