MCPcopy
hub / github.com/simstudioai/sim / getTimezoneOptions

Function getTimezoneOptions

apps/sim/lib/core/utils/timezone.ts:70–83  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68 * ids — what we persist.
69 */
70export function getTimezoneOptions(): TimezoneOption[] {
71 const now = new Date()
72 return getSupportedTimezones()
73 .map((value) => ({
74 value,
75 city: timezoneCity(value),
76 offsetMinutes: Math.round(timezoneOffsetMs(now, value) / 60_000),
77 }))
78 .sort((a, b) => a.city.localeCompare(b.city))
79 .map(({ value, city, offsetMinutes }) => ({
80 value,
81 label: `${city} (${formatGmtOffset(offsetMinutes)})`,
82 }))
83}
84
85/**
86 * An instant's wall-clock time in `timeZone` as a naive `yyyy-MM-ddTHH:mm`

Callers 2

timezone.test.tsFile · 0.90
general.tsxFile · 0.90

Calls 4

getSupportedTimezonesFunction · 0.85
timezoneCityFunction · 0.85
timezoneOffsetMsFunction · 0.85
formatGmtOffsetFunction · 0.85

Tested by

no test coverage detected