fix: Cannot read properties of undefined (reading 'timeZone') (#18107)
Co-authored-by: Hariom <hariombalhara@gmail.com>
This commit is contained in:
1 parent
6f531d0be5
commit
6178092878
1 file changed
+6
-2
@@ -24,14 +24,18 @@ export const getWhen = (
|
||||
calEvent: Pick<CalendarEvent, "organizer" | "attendees" | "seatsPerTimeSlot">,
|
||||
t: TFunction
|
||||
) => {
|
||||
const organizerTimezone = calEvent.organizer?.timeZone ?? "UTC";
|
||||
const defaultTimezone = organizerTimezone;
|
||||
const attendeeTimezone = calEvent.attendees?.[0]?.timeZone ?? defaultTimezone;
|
||||
|
||||
return calEvent.seatsPerTimeSlot
|
||||
? `
|
||||
${t("organizer_timezone")}:
|
||||
${calEvent.organizer.timeZone}
|
||||
${organizerTimezone}
|
||||
`
|
||||
: `
|
||||
${t("invitee_timezone")}:
|
||||
${calEvent.attendees[0].timeZone}
|
||||
${attendeeTimezone}
|
||||
`;
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user