Skip to content

Commit 38155ba

Browse files
committed
fix(timezone): format automatic timezone label
1 parent 59c6d99 commit 38155ba

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

apps/sim/app/workspace/[workspaceId]/settings/components/general/timezone-picker.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ import {
99
timezonePreferenceFromPickerValue,
1010
} from '@/app/workspace/[workspaceId]/settings/components/general/timezone-picker'
1111

12-
const timezoneOptions = [{ label: 'Los Angeles', value: 'America/Los_Angeles' }]
12+
const timezoneOptions = [{ label: 'Los Angeles (GMT-07:00)', value: 'America/Los_Angeles' }]
1313

1414
describe('getTimezonePickerPresentation', () => {
1515
it('shows an unset preference as an explicit browser-managed option', () => {
1616
expect(getTimezonePickerPresentation(null, 'America/Los_Angeles', timezoneOptions)).toEqual({
1717
value: AUTO_TIMEZONE_OPTION_VALUE,
1818
options: [
19-
{ label: 'Auto: America/Los_Angeles', value: AUTO_TIMEZONE_OPTION_VALUE },
19+
{ label: 'Auto: Los Angeles (GMT-07:00)', value: AUTO_TIMEZONE_OPTION_VALUE },
2020
...timezoneOptions,
2121
],
2222
})

apps/sim/app/workspace/[workspaceId]/settings/components/general/timezone-picker.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,16 @@ export function getTimezonePickerPresentation(
2424
: null
2525
const safeInvalidTimezone =
2626
savedTimezone === null ? '' : sanitizeTimezoneForDisplay(savedTimezone)
27+
const browserTimezoneLabel =
28+
timezoneOptions.find((option) => option.value === browserTimezone)?.label ??
29+
sanitizeTimezoneForDisplay(browserTimezone)
2730

2831
return {
2932
value: hasInvalidTimezone
3033
? INVALID_TIMEZONE_OPTION_VALUE
3134
: (savedTimezone ?? AUTO_TIMEZONE_OPTION_VALUE),
3235
options: [
33-
{ label: `Auto: ${browserTimezone}`, value: AUTO_TIMEZONE_OPTION_VALUE },
36+
{ label: `Auto: ${browserTimezoneLabel}`, value: AUTO_TIMEZONE_OPTION_VALUE },
3437
...(hasInvalidTimezone
3538
? [
3639
{

0 commit comments

Comments
 (0)