Skip to content

Commit

Permalink
fix: Cannot read properties of undefined (reading 'timeZone') (calcom…
Browse files Browse the repository at this point in the history
…#18107)

Co-authored-by: Hariom <hariombalhara@gmail.com>
  • Loading branch information
2 people authored and MuhammadAimanSulaiman committed Feb 24, 2025
1 parent d8690b6 commit 5956f57
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/lib/CalEventParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}
`;
};

Expand Down

0 comments on commit 5956f57

Please sign in to comment.