Which territory a caller means: the CLDR territory (:US, :SA, :GB)
whose weekend, workdays and conventions Tempo asks Localize for.
A territory may be named directly, taken from a locale, or left to the
application: nil is the configured :default_territory, and failing
that the territory of the current locale.
config :ex_tempo, default_territory: :AU
Summary
Functions
The territory a value names.
Functions
@spec resolve(atom() | String.t() | Localize.LanguageTag.t() | nil) :: {:ok, atom()} | {:error, Exception.t()}
The territory a value names.
Arguments
valueis a territory as an atom or a string (:US,"sa"), a locale ("en-GB", aLocalize.LanguageTag.t/0) whose territory is taken, ornilfor the application's:default_territoryand then the current locale's.
Returns
{:ok, territory}, an atom.{:error, %ArgumentError{}}for a value that names none.
Examples
iex> Tempo.Territory.resolve(:US)
{:ok, :US}
iex> Tempo.Territory.resolve("sa")
{:ok, :SA}
iex> Tempo.Territory.resolve("en-GB")
{:ok, :GB}
iex> {:error, %ArgumentError{}} = Tempo.Territory.resolve("nowhere at all")