Skip to content

Commit

Permalink
fix: change timezone test pst key to pst8pdt
Browse files Browse the repository at this point in the history
  • Loading branch information
sensecodevalue committed Jun 20, 2024
1 parent e423c14 commit 5f2c73e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/date-util/date-util.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ describe('DateUtil', () => {
expect(
format(testDatetime, { format: 'YYYY-MM-DDTHH:mm:ss.SSSZZ', isUtc: false, timeZone: 'Asia/Seoul' })
).toEqual(`2022-02-23T10:23:45.678+0900`);
expect(format(testDatetime, { isUtc: false, timeZone: 'PST' })).toBe('2022-02-22 17:23:45');
expect(format(testDatetime, { isUtc: false, timeZone: 'PST8PDT' })).toBe('2022-02-22 17:23:45');
});
});

Expand All @@ -367,7 +367,7 @@ describe('DateUtil', () => {
expect(formatInIso8601(testDatetime, { format: DATETIME_FORMAT, isUtc: false, timeZone: 'Asia/Seoul' })).toEqual(
`2022-02-23T10:23:45+09:00`
);
expect(formatInIso8601(testDatetime, { isUtc: false, timeZone: 'PST' })).toEqual('2022-02-22T17:23:45-08:00');
expect(formatInIso8601(testDatetime, { isUtc: false, timeZone: 'PST8PDT' })).toEqual('2022-02-22T17:23:45-08:00');
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/date-util/date-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
import type { LocalDateTimeFormatOpts, TimeAnnotationSet } from './date-util.interface';
import type { CalcDatetimeOpts, DatetimeFormatOpts, IsoDatetimeFormatOpts } from './date-util.type';

const timeZoneMap: Record<TimeZoneType, number> = { 'Asia/Seoul': 540, 'Asia/Tokyo': 540, PST: -480, UTC: 0 };
const timeZoneMap: Record<TimeZoneType, number> = { 'Asia/Seoul': 540, 'Asia/Tokyo': 540, PST8PDT: -480, UTC: 0 };
const logger = LoggerFactory.getLogger('pebbles:date-util');

export namespace DateUtil {
Expand Down

0 comments on commit 5f2c73e

Please sign in to comment.