Skip to content
Merged
Show file tree
Hide file tree
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: 5 additions & 1 deletion src/libs/DateUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,11 @@ function datetimeToRelative(locale: Locale | undefined, datetime: string, curren
* @returns
*/
function getZoneAbbreviation(datetime: string | Date, selectedTimezone: SelectedTimezone): string {
return formatInTimeZone(datetime, selectedTimezone, 'zzz');
const abbreviation = formatInTimeZone(datetime, selectedTimezone, 'zzz');
if (abbreviation === 'GMT') {
return formatInTimeZone(datetime, selectedTimezone, 'O');
}
return abbreviation;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/DateUtilsTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('DateUtils', () => {

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

it('formatToLongDateWithWeekday should return a long date with a weekday', () => {
Expand Down
Loading