Skip to content

Extras

TimeZonePicker

Bit.BlazorUI.ExtrasTimeZoneSelectorTimeZoneSelectTzPicker

BitTimeZonePicker picks a time zone out of a searchable list that shows the offset from UTC, the place and the country of each one - for the time zone of a profile, a meeting or a report, and for the TimeZone of the date and time pickers. Value is a TimeZoneInfo or the IANA id of the time zone, whichever it is bound to; the list is the same on every runtime, Windows ids and renamed IANA ids are recognized, the visitor's own time zone can be preselected from the browser, and the whole field is keyboard and screen-reader operable.

List & search

Replacing the list, preferred time zones, the search box, the offsets and countries shown, and templates for the field and the rows.

Custom time zones

TimeZones replaces the built-in list (BitTimeZones.All) - filter it to narrow the choice down. Whatever order it is given in, the list is shown by offset.

Preferred time zones

PreferredTimeZones pins time zones to the top of the list, set apart from the rest by a rule. They are written as ids, of any kind the picker recognizes.

Search box

The search matches places and countries (accents folded, word starts, so sao pa finds Sao Paulo and paris fr finds Paris), ids (Asia/Calcutta, UTC), the regions of the Windows names (pacific, central europe) and offsets (+3:30, utc-5, gmt+0530; +5 finds every zone of the hour). The result count is announced to screen readers. Typing on the closed field opens it with the search already started. SearchBoxPlaceholder, SearchBoxAriaLabel and NoResultsText set its texts. NoSearchBox removes it; the field then answers to type-ahead, open or closed. The same letter typed again cycles through the time zones starting with it, and what is typed is matched by the rules of the current culture, which ignore case and the accents that culture treats as marks on a letter.

Offsets & countries

The offsets are the ones in force now, daylight saving time included. ReferenceDate computes them - and orders the list - for another moment, such as the date of an event. NoOffset leaves the offsets out of the field and the list, and NoCountry the country names.

Templates

ValueTemplate renders the content of the field from the selected BitTimeZone, ItemTemplate each row, and NoResultsTemplate the empty result.

Feedback

Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.