()
| 68 | * ids — what we persist. |
| 69 | */ |
| 70 | export 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` |
no test coverage detected