Defines the enumeration for days of the week. Each variant corresponds to a day of the week.
- monday : Std.Time.Weekday
Monday.
- tuesday : Std.Time.Weekday
Tuesday.
- wednesday : Std.Time.Weekday
Wednesday.
- thursday : Std.Time.Weekday
Thursday.
- friday : Std.Time.Weekday
Friday.
- saturday : Std.Time.Weekday
Saturday.
- sunday : Std.Time.Weekday
Sunday.
Instances For
Equations
- Std.Time.instReprWeekday = { reprPrec := Std.Time.reprWeekday✝ }
Equations
- Std.Time.instInhabitedWeekday = { default := Std.Time.Weekday.monday }
Equations
- Std.Time.instBEqWeekday = { beq := Std.Time.beqWeekday✝ }
Ordinal
represents a bounded value for weekdays, which ranges between 1 and 7.
Equations
Instances For
Equations
- Std.Time.Weekday.instOfNatOrdinal = inferInstanceAs (OfNat (Std.Time.Internal.Bounded.LE 1 (1 + ↑6)) n)
Converts a Ordinal
representing a day index into a corresponding Weekday
. This function is useful
for mapping numerical representations to days of the week.
Equations
- Std.Time.Weekday.ofOrdinal ⟨Int.ofNat 1, ⋯⟩ = Std.Time.Weekday.monday
- Std.Time.Weekday.ofOrdinal ⟨Int.ofNat 2, ⋯⟩ = Std.Time.Weekday.tuesday
- Std.Time.Weekday.ofOrdinal ⟨Int.ofNat 3, ⋯⟩ = Std.Time.Weekday.wednesday
- Std.Time.Weekday.ofOrdinal ⟨Int.ofNat 4, ⋯⟩ = Std.Time.Weekday.thursday
- Std.Time.Weekday.ofOrdinal ⟨Int.ofNat 5, ⋯⟩ = Std.Time.Weekday.friday
- Std.Time.Weekday.ofOrdinal ⟨Int.ofNat 6, ⋯⟩ = Std.Time.Weekday.saturday
- Std.Time.Weekday.ofOrdinal ⟨Int.ofNat 7, ⋯⟩ = Std.Time.Weekday.sunday
Instances For
Converts a Weekday
to a Ordinal
.
Equations
- Std.Time.Weekday.monday.toOrdinal = 1
- Std.Time.Weekday.tuesday.toOrdinal = 2
- Std.Time.Weekday.wednesday.toOrdinal = 3
- Std.Time.Weekday.thursday.toOrdinal = 4
- Std.Time.Weekday.friday.toOrdinal = 5
- Std.Time.Weekday.saturday.toOrdinal = 6
- Std.Time.Weekday.sunday.toOrdinal = 7
Instances For
Equations
- Std.Time.Weekday.monday.toNat = 1
- Std.Time.Weekday.tuesday.toNat = 2
- Std.Time.Weekday.wednesday.toNat = 3
- Std.Time.Weekday.thursday.toNat = 4
- Std.Time.Weekday.friday.toNat = 5
- Std.Time.Weekday.saturday.toNat = 6
- Std.Time.Weekday.sunday.toNat = 7
Instances For
@[inline]
Converts a Nat
to a Weekday
. Panics if the value provided is invalid.
Equations
- Std.Time.Weekday.ofNat! n = match Std.Time.Weekday.ofNat? n with | some res => res | none => panicWithPosWithDecl "Std.Time.Date.Unit.Weekday" "Std.Time.Weekday.ofNat!" 110 12 "invalid weekday"
Instances For
Gets the next Weekday
.
Equations
- Std.Time.Weekday.monday.next = Std.Time.Weekday.tuesday
- Std.Time.Weekday.tuesday.next = Std.Time.Weekday.wednesday
- Std.Time.Weekday.wednesday.next = Std.Time.Weekday.thursday
- Std.Time.Weekday.thursday.next = Std.Time.Weekday.friday
- Std.Time.Weekday.friday.next = Std.Time.Weekday.saturday
- Std.Time.Weekday.saturday.next = Std.Time.Weekday.sunday
- Std.Time.Weekday.sunday.next = Std.Time.Weekday.monday
Instances For
Check if it's a weekend.
Equations
- Std.Time.Weekday.saturday.isWeekend = true
- Std.Time.Weekday.sunday.isWeekend = true
- x✝.isWeekend = false