Skip to content

Scheduling infrastructure for absolutely everyone.

fix: google calendar event creation failure due to invalid timezone (#22048)

Anik Dhabal Babuc10f15e75bcb
diff --git a/packages/features/components/timezone-select/TimezoneSelect.tsx b/packages/features/components/timezone-select/TimezoneSelect.tsx
index e6d2c915be7..337f0e008a4 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<string, string> = {
+ "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) => (
<p className="truncate">{(option as ITimezoneOption).value.replace(/_/g, " ")}</p>
)}