Skip to content

Commit

Permalink
fix(TDOPS-5889/TimezoneList): fix timezone name (#5089)
Browse files Browse the repository at this point in the history
  • Loading branch information
yyanwang authored Dec 27, 2023
1 parent 3a8b832 commit eeec10c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/perfect-frogs-argue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/react-forms': patch
---

fix timezone names
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import get from 'lodash/get';

import { date as dateUtils } from '@talend/utils';

/**
Expand Down Expand Up @@ -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));
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ describe('getTimezones', () => {
},
Europe: {
Istanbul: { exemplarCity: '[EN] Istanbul' },
Berlin: { long: { daylight: 'Irish Standard Time' } },
},
},
},
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit eeec10c

Please sign in to comment.