fix: timezone-dropdown (#23469)
* fix: timezone-dropdown closes: #23453 * coderabbit suggestion Signed-off-by: Hemant M Mehta <[email protected]> * Update timezone.ts --------- Signed-off-by: Hemant M Mehta <[email protected]> Co-authored-by: Anik Dhabal Babu <[email protected]>
This commit is contained in:
co-authored by
Anik Dhabal Babu
parent
4fb3639f71
commit
5ebd33576a
@@ -28,7 +28,7 @@ const formatOffset = (offset: string) =>
|
||||
offset.replace(/^([-+])(0)(\d):00$/, (_, sign, _zero, hour) => `${sign}${hour}:00`);
|
||||
|
||||
export const handleOptionLabel = (option: ITimezoneOption, timezones: Timezones) => {
|
||||
const offsetUnit = option.label.split("-")[0].substring(1);
|
||||
const offsetUnit = option.label.split(/[-+]/)[0].substring(1);
|
||||
const cityName = option.label.split(") ")[1];
|
||||
|
||||
const timezoneValue = ` ${offsetUnit} ${formatOffset(dayjs.tz(undefined, option.value).format("Z"))}`;
|
||||
|
||||
Reference in New Issue
Block a user