Date & time

Timezone select

@xui/timezone-select

A searchable time-zone picker: the runtime's IANA zones (via Intl.supportedValuesOf('timeZone')) fed into xui-select, each labelled with its current GMT offset. The value is the selected IANA id (a string), bound with [(value)] or a form control.

Install

pnpm add @xui/timezone-select

Add the barrel to a standalone component's imports:

import { XuiTimezoneSelectImports } from '@xui/timezone-select';

@Component({
  imports: [XuiTimezoneSelectImports],
  // …
})

Examples

Default

Loading preview…

Two way binding

Loading preview…

Reactive form

Loading preview…

Disabled

Loading preview…

API

XuiTimezoneSelect

componentxui-timezone-select

A searchable time-zone picker: the runtime's IANA zones (via Intl.supportedValuesOf('timeZone')) fed into xui-select, each labelled with its current GMT offset. [(value)] holds the selected IANA id (a string).

Inputs

NameTypeDefaultclassClassValueThe user-defined classes. Merged last so they win over the variant classes.''placeholderstringText shown while no zone is chosen.'Select a time zone…'ariaLabelstringNames the combobox; the placeholder is only shown until something is picked.'Time zone'disabledbooleanBlock interaction and dim the control.falsedateDateReference instant used to compute offsets (defaults to "now" at first render).new Date(0)valuetwo-waystring | nullThe selected IANA time-zone id. Two-way bindable with [(value)], or via formControl/ngModel.null

Source

libs/ui/timezone-select/xui

xUI 2.0.0 — Apache 2.0 licensed. Built with Angular and Tailwind CSS.