Cldr.Calendar.weekdays

You're seeing just the function weekdays, 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 week days

Notes

The list of days may not my monotonic. See the example for Saudi Arabia below.

Examples

iex> Cldr.Calendar.weekdays("US")
[1, 2, 3, 4, 5]

iex> Cldr.Calendar.weekdays("IN")
[1, 2, 3, 4, 5, 6]

iex> Cldr.Calendar.weekdays("SA")
[1, 2, 3, 4, 7]

iex> Cldr.Calendar.weekdays("yy")
{:error, {Cldr.UnknownTerritoryError, "The territory \"yy\" is unknown"}}