Skip to main content
Module

x/complaindate/mod.ts>supportedCanonicalTimezones

JavaScript date-time utilities that keep timezones on the surface
Latest
function supportedCanonicalTimezones
import { supportedCanonicalTimezones } from "https://deno.land/x/complaindate@v1.0.1/mod.ts";

Get all canonical timezones that are supported by the browser or runtime, or an empty array if the list is not available.

This is useful for populating an HTML <datalist id="availableTimezones"> with all relevant timezones, enabling an ordinary <input type="text" list="availableTimezones"> to become an autocomplete "combobox" for the user to select from. See datalist documentation on MDN for details and examples.

Most browsers and runtime systems expose this list of 400+ timezones since March or April 2022. See compatibility data on MDN for details.

Returns

string[]