diff --git a/spec/core/HDateTime.spec.ts b/spec/core/HDateTime.spec.ts index 6273fe2..06260b8 100644 --- a/spec/core/HDateTime.spec.ts +++ b/spec/core/HDateTime.spec.ts @@ -398,6 +398,10 @@ describe('HDateTime', function (): void { expect(getTimeZone('New_York')).toBe('America/New_York') }) + it('returns a timezone that contains multiple segements', () => { + expect(getTimeZone('Knox')).toBe('America/Indiana/Knox') + }) + it('returns an empty string for an invalid timezone', function (): void { expect(getTimeZone('FooBar')).toBe('') }) @@ -416,6 +420,12 @@ describe('HDateTime', function (): void { ) }) + it('returns a valid timezone that contains multiple segements', () => { + expect(HDateTime.getIANATimeZone('La_Rioja')).toBe( + 'America/Argentina/La_Rioja' + ) + }) + it('returns an empty string for an invalid timezone', function (): void { expect(HDateTime.getIANATimeZone('FooBar')).toBe('') }) diff --git a/src/core/HDateTime.ts b/src/core/HDateTime.ts index 03d92f5..6f8bbb0 100644 --- a/src/core/HDateTime.ts +++ b/src/core/HDateTime.ts @@ -48,6 +48,10 @@ const TIMEZONE_PREFIXES = [ 'Mexico', 'Pacific', 'US', + 'America/Argentina', + 'America/Indiana', + 'America/Kentucky', + 'America/North_Dakota', ] /**