Skip to content

TimezoneSelect

A time zone, searchable by city, with its offset: «America/Bogota (UTC-5)».

import { TimezoneSelect } from '@sypnia/ui/react'

On this page
  1. The project's zone
  2. When to use it
  3. For everyone
  4. Props

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

TimezoneSelectTypeDefault
aria-describedby string
aria-label

The name for screen readers when there is no Field around it.

string
aria-labelledby string
className string
disabled boolean
id

Inside a Field it comes from the Field.

string
name string
onChange ((tz: string | null) => void)
placeholder string
value string
zones string[]
  1. The project&#39;s zone
  2. When to use it
  3. For everyone
  4. Props

    Search pages, sections and terms