Skip to content

Commit c10f15e

Browse files
authored
fix: google calendar event creation failure due to invalid timezone (calcom#22048)
* fix: google calendar event creation failure * update * fix type error * Update TimezoneSelect.tsx
1 parent 6983179 commit c10f15e

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

packages/features/components/timezone-select/TimezoneSelect.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,24 @@ export function TimezoneSelectComponent({
127127
}}
128128
onInputChange={handleInputChange}
129129
{...props}
130+
onChange={(selectedOption) => {
131+
if (!props.onChange) return;
132+
133+
if (!selectedOption) {
134+
props.onChange(selectedOption);
135+
return;
136+
}
137+
138+
// Fix inconsistent timezone naming formats
139+
const corrections: Record<string, string> = {
140+
"America/Port_Of_Spain": "America/Port_of_Spain",
141+
"Africa/Porto-novo": "Africa/Porto-Novo",
142+
"Africa/Dar_Es_Salaam": "Africa/Dar_es_Salaam",
143+
};
144+
145+
const correctedValue = corrections[selectedOption.value] || selectedOption.value;
146+
props.onChange({ ...selectedOption, value: correctedValue });
147+
}}
130148
formatOptionLabel={(option) => (
131149
<p className="truncate">{(option as ITimezoneOption).value.replace(/_/g, " ")}</p>
132150
)}

0 commit comments

Comments
 (0)