From c10f15e75bcb5af063f74180bf8c619cedc92f1f Mon Sep 17 00:00:00 2001 From: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Date: Thu, 26 Jun 2025 15:06:44 +0530 Subject: [PATCH] fix: google calendar event creation failure due to invalid timezone (#22048) * fix: google calendar event creation failure * update * fix type error * Update TimezoneSelect.tsx --- .../timezone-select/TimezoneSelect.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/features/components/timezone-select/TimezoneSelect.tsx b/packages/features/components/timezone-select/TimezoneSelect.tsx index e6d2c915be..337f0e008a 100644 --- a/packages/features/components/timezone-select/TimezoneSelect.tsx +++ b/packages/features/components/timezone-select/TimezoneSelect.tsx @@ -127,6 +127,24 @@ export function TimezoneSelectComponent({ }} onInputChange={handleInputChange} {...props} + onChange={(selectedOption) => { + if (!props.onChange) return; + + if (!selectedOption) { + props.onChange(selectedOption); + return; + } + + // Fix inconsistent timezone naming formats + const corrections: Record = { + "America/Port_Of_Spain": "America/Port_of_Spain", + "Africa/Porto-novo": "Africa/Porto-Novo", + "Africa/Dar_Es_Salaam": "Africa/Dar_es_Salaam", + }; + + const correctedValue = corrections[selectedOption.value] || selectedOption.value; + props.onChange({ ...selectedOption, value: correctedValue }); + }} formatOptionLabel={(option) => (

{(option as ITimezoneOption).value.replace(/_/g, " ")}

)}