TimezoneSelect
Una zona horaria, que se busca por ciudad, con su diferencia: «America/Bogota (UTC-5)».
import { TimezoneSelect } from '@sypnia/ui/react'
En esta página
La zona del proyecto
Schedules and daily reports follow it.
Código
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>;
} Cuándo usarlo
Úsalo cuando
- Proyectos y horarios que corren a horas locales.
No lo uses cuando
- Mostrar horas: formátalas en la zona de la persona en vez de preguntar.
Para todos
- Es un combobox: escribe parte de una ciudad para acortar la lista.
Props
| TimezoneSelect | Tipo | Por defecto |
|---|---|---|
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[] |