Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/unit/DateUtilsTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ describe('DateUtils', () => {
});

const datetime = '2022-11-07 00:00:00';
const timezone = 'America/Los_Angeles';
const timezone = 'Atlantic/Reykjavik';

it('getZoneAbbreviation should show zone abbreviation from the datetime', () => {
const zoneAbbreviation = DateUtils.getZoneAbbreviation(datetime, timezone);
expect(zoneAbbreviation).toBe('GMT-8');
expect(zoneAbbreviation).toBe('GMT');
});

it('formatToLongDateWithWeekday should return a long date with a weekday', () => {
Expand All @@ -72,7 +72,7 @@ describe('DateUtils', () => {

it('should return a date object with the formatted datetime when calling getLocalDateFromDatetime', () => {
const localDate = DateUtils.getLocalDateFromDatetime(LOCALE, timezone, datetime);
expect(tzFormat(localDate, CONST.DATE.FNS_TIMEZONE_FORMAT_STRING, {timeZone: timezone})).toEqual('2022-11-06T16:00:00-08:00');
expect(tzFormat(localDate, CONST.DATE.FNS_TIMEZONE_FORMAT_STRING, {timeZone: timezone})).toEqual('2022-11-07T00:00:00Z');
});

it('should fallback to current date when getLocalDateFromDatetime is failing', () => {
Expand Down