Cldr.Calendar.weekday-question-mark

You're seeing just the function weekday-question-mark, go back to Cldr.Calendar module for more information.
Link to this function

weekday?(date, options \\ [])

View Source

Specs

weekday?(Date.t(), Keyword.t()) :: boolean() | {:error, {module(), String.t()}}

Returns whether a given date is a weekday.

Weekdays are locale-specific and depend on the policies of a given territory (country).

Arguments

  • date is any Date.t()

  • options is a Keyword list of options

Options

  • :locale is any locale or locale name validated by Cldr.validate_locale/2. The default is Cldr.get_locale() which returns the locale set for the current process

  • :territory is any valid ISO-3166-2 territory that is validated by Cldr.validate_territory/1

  • :backend is any Cldr backend module. See the backend configuration documentation for further information. The default is Cldr.Calendar.Backend.Default which configures only the en locale.

Notes

When identifying which territory context within which to determine whether a given day is a weekday or not the following order applies:

  • A territory specified by the :territory option

  • The territory defined as part of the :locale option

  • The territory defined as part of the current processes default locale.

Examples

# The defalt locale for `Cldr` is `en-001` for which
# the territory is `001` (the world). The weekdays
# for `001` are Monday to Friday
iex> Cldr.Calendar.weekday? ~D[2019-03-23], locale: "en"
false

iex> Cldr.Calendar.weekday? ~D[2019-03-23], territory: "IS"
false

# Saturday is a weekday in India
iex> Cldr.Calendar.weekday? ~D[2019-03-23], locale: "en-IN", backend: MyApp.Cldr
true

# Friday is not a weekday in Saudi Arabia
iex> Cldr.Calendar.weekday? ~D[2019-03-22], locale: "ar-SA", backend: MyApp.Cldr
false

# Friday is not a weekday in Israel
iex> Cldr.Calendar.weekday? ~D[2019-03-22], locale: "he", backend: MyApp.Cldr
false