TimezoneSelect
A time zone, searchable by city, with its offset: «America/Bogota (UTC-5)».
import { TimezoneSelect } from '@sypnia/ui/react'
The project's zone
Schedules and daily reports follow it.
Code
import { useState } from 'react';
import { Field, TimezoneSelect } from '@sypnia/ui/react';
// Search by city: «bog», «madrid».
export default function Zone() {
const [tz, setTz] = useState<string | null>('America/Bogota');
return <Field label="Project time zone" hint="Schedules and daily reports follow it."><TimezoneSelect value={tz ?? undefined} onChange={setTz} /></Field>;
} When to use it
Use it when
- Projects and schedules that run at local times.
Do not use it when
- Showing times: format them in the person's zone instead of asking.
For everyone
- It is a combobox: type part of a city to narrow the list.
Props
| TimezoneSelect | Type | Default |
|---|---|---|
aria-describedby | string | |
aria-labelThe name for screen readers when there is no Field around it. | string | |
aria-labelledby | string | |
className | string | |
disabled | boolean | |
idInside a Field it comes from the Field. | string | |
name | string | |
onChange | ((tz: string | null) => void) | |
placeholder | string | |
value | string | |
zones | string[] |