Cldr.Calendar.weekend

You're seeing just the function weekend, go back to Cldr.Calendar module for more information.

Returns a list of the days of the week that are considered a weekend for a given territory (country)

Arguments

  • territory is any valid ISO3166-2 code

Returns

  • A list of integers representing the days of the week that are weekend days

Examples

iex> Cldr.Calendar.weekend("US")
[6, 7]

iex> Cldr.Calendar.weekend("IN")
[7]

iex> Cldr.Calendar.weekend("SA")
[5, 6]

iex> Cldr.Calendar.weekend("xx")
{:error, {Cldr.UnknownTerritoryError, "The territory :XX is unknown"}}