LanguageValues and typesStandard typesTime and calendar
Weekday
On this page
A day of the week: monday to sunday.
Use it for opening days and weekly schedules. temporal.weekday gives one from a date. For a whole week's opening times, use OpeningHours.
Shape
One of these 7 values:
Weekday.monday, Weekday.tuesday, Weekday.wednesday, Weekday.thursday, Weekday.friday, Weekday.saturday, Weekday.sunday.
Example
Weekday.mondaytext.parse(raw, as: Weekday) reads one from text that comes from outside. Text that isn't one at all fails malformed, such as mon or funday.
This operation gives one: temporal.weekday.
Good to know
==tells you whether two are the same.<andlist.sort_bydon't take it.
In JSON
A string, in a request, a response or json.write:
"monday""sunday"
Details
Text form, storage, how it is shown, and operations
Weekday is in the group Time and calendar, and has been in Jadpo since 0.1.0.
Text form
text.from writes one standard text form, the same form text.parse reads back: monday and sunday.
How it is stored
It is stored in one column named for the field, of type text. sunday is stored as 'sunday'.
How it is shown to people
text.format(value, locale:) shows it to people in their locale.
With locale: Locale.en_gb:
| Value | Shown |
|---|---|
monday |
Monday |
sunday |
Sunday |
Operations
temporal.week_bounds(date: CalendarDate, zone: Zone, starts_on: Weekday) -> InstantRange: The week holdingdateinzone, starting onstarts_on.temporal.weekday(value: T) -> Weekday: The day of the week.
It also takes text.parse, text.from, text.format, json.read, json.write and ==. How every standard type behaves says how they work.
Markdown for agents: /docs/types/type-weekday.md.Built from Jadpo main at aee2e8f.