feat: Add Eastern and Eastern Pacific time zones #16880 (#16974)

* add eastern and eastern pacific timezones

* fixed issue while running tests.

* fix: Find Braz..il instead of Brasil

---------

Co-authored-by: Alex van Andel <[email protected]>
This commit is contained in:
Shrey TannaandAlex van Andel authored and GitHub committed 2024-10-10 16:26:17 +00:00
1 parent 711bec8d71
commit b1cd3e940e
5 files changed
+181 -28

No files matched your search

@@ -0,0 +1,64 @@
{
"timezones": [
{
"name": "Eastern Time - US & Canada",
"identifier": "America/New_York"
},
{
"name": "Pacific Time - US & Canada",
"identifier": "America/Los_Angeles"
},
{
"name": "Central Time - US & Canada",
"identifier": "America/Chicago"
},
{
"name": "Mountain Time - US & Canada",
"identifier": "America/Denver"
},
{
"name": "Atlantic Time - Canada",
"identifier": "America/Halifax"
},
{
"name": "Eastern European Time",
"identifier": "Europe/Bucharest"
},
{
"name": "Central European Time",
"identifier": "Europe/Berlin"
},
{
"name": "Western European Time",
"identifier": "Europe/London"
},
{
"name": "Australian Eastern Time",
"identifier": "Australia/Sydney"
},
{
"name": "Japan Standard Time",
"identifier": "Asia/Tokyo"
},
{
"name": "India Standard Time",
"identifier": "Asia/Kolkata"
},
{
"name": "Gulf Standard Time",
"identifier": "Asia/Dubai"
},
{
"name": "South Africa Standard Time",
"identifier": "Africa/Johannesburg"
},
{
"name": "Brazil Time",
"identifier": "America/Sao_Paulo"
},
{
"name": "Hawaii-Aleutian Standard Time",
"identifier": "Pacific/Honolulu"
}
]
}
@@ -0,0 +1,10 @@
import * as additionalTimezones from "./additionalTimezones.json";
export interface Timezone {
name: string;
identifier: string;
}
export const timezones: Timezone[] = additionalTimezones.timezones;
export default additionalTimezones;
+6
View File
@@ -3,6 +3,7 @@ import type { ITimezoneOption } from "react-timezone-select";
import dayjs from "@calcom/dayjs";
import type { ICity } from "@calcom/ui/components/form/timezone-select";
import { timezones as additionalTimezones } from "../features/additionalTimezones/additionalTimezones";
import isProblematicTimezone from "./isProblematicTimezone";
function findPartialMatch(itemsToSearch: string, searchString: string) {
@@ -30,6 +31,11 @@ export const addCitiesToDropdown = (cities: ICity[]) => {
}
return acc;
}, {});
additionalTimezones.forEach((tz) => {
cityTimezones[tz.identifier] = tz.name;
});
return cityTimezones || {};
};