diff --git a/.changeset/perfect-frogs-argue.md b/.changeset/perfect-frogs-argue.md new file mode 100644 index 00000000000..014405f2d3e --- /dev/null +++ b/.changeset/perfect-frogs-argue.md @@ -0,0 +1,5 @@ +--- +'@talend/react-forms': patch +--- + +fix timezone names diff --git a/packages/forms/src/UIForm/fields/TimezoneList/TimezoneList.utils.js b/packages/forms/src/UIForm/fields/TimezoneList/TimezoneList.utils.js index 02fc7df9bcf..212ae9d1300 100644 --- a/packages/forms/src/UIForm/fields/TimezoneList/TimezoneList.utils.js +++ b/packages/forms/src/UIForm/fields/TimezoneList/TimezoneList.utils.js @@ -1,4 +1,5 @@ import get from 'lodash/get'; + import { date as dateUtils } from '@talend/utils'; /** @@ -50,7 +51,10 @@ export function getTimezones(lang, cldrTimezones) { } else { // Ex: America/Argentina/Buenos_Aires ... Object.keys(zones[region][city]).forEach(city2 => { - const timezone = `${region}/${city}/${city2}`; + let timezone = `${region}/${city}`; + if (city2 !== 'long') { + timezone = `${region}/${city}/${city2}`; + } newTimezones.push(getTimezoneInfo(timezone)); }); } diff --git a/packages/forms/src/UIForm/fields/TimezoneList/TimezoneList.utils.test.js b/packages/forms/src/UIForm/fields/TimezoneList/TimezoneList.utils.test.js index 2a0f57fbab9..129e7a8e99c 100644 --- a/packages/forms/src/UIForm/fields/TimezoneList/TimezoneList.utils.test.js +++ b/packages/forms/src/UIForm/fields/TimezoneList/TimezoneList.utils.test.js @@ -14,6 +14,7 @@ describe('getTimezones', () => { }, Europe: { Istanbul: { exemplarCity: '[EN] Istanbul' }, + Berlin: { long: { daylight: 'Irish Standard Time' } }, }, }, }, @@ -87,6 +88,12 @@ describe('getTimezones', () => { offset: 0, value: 'Africa/Freetown', }, + { + name: '(UTC +01:00) Europe/Berlin', + offset: 60, + timezoneName: 'Europe/Berlin', + value: 'Europe/Berlin', + }, { name: '(UTC +03:00) [EN] Istanbul', timezoneName: '[EN] Istanbul',