FirstWeekType
FirstWholeWeek
- first week is the first whole week of the yearFirstMostWeek
- first week is the first week with four days in the year
- FirstWholeWeek: Time.FirstWeekType
- FirstMostWeek: Time.FirstWeekType
Instances For
Equations
- Time.instReprFirstWeekType = { reprPrec := Time.reprFirstWeekType✝ }
Equations
- Time.instBEqFirstWeekType = { beq := Time.beqFirstWeekType✝ }
The number of days from b to the next a.
Equations
- Time.dayOfWeekDiff a b = (a.fromDayOfWeek - b.fromDayOfWeek).emod 7
Instances For
theorem
Time.dayOfWeekDiff_range
(a b : Time.DayOfWeek)
:
0 ≤ Time.dayOfWeekDiff a b ∧ Time.dayOfWeekDiff a b ≤ 6
dayOfWeekDiff a b = a - b
in range 0 to 6.
The first day-of-week on or after some day
Equations
Instances For
Equations
- Time.firstDayOfWeekCalendar Time.FirstWeekType.FirstWholeWeek dow year = Time.firstDayOfWeekOnAfter dow (Time.fromOrdinalDate (Time.firstDayOfYearDate year))
- Time.firstDayOfWeekCalendar Time.FirstWeekType.FirstMostWeek dow year = Time.firstDayOfWeekOnAfter dow (Time.Day.addDays (-3) (Time.fromOrdinalDate (Time.firstDayOfYearDate year)))
Instances For
Convert to the given kind of "week calendar". Note that the year number matches the weeks, and so is not always the same as the Gregorian year number.
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Time.fromWeekCalendar
(wt : Time.FirstWeekType)
(ws : Time.DayOfWeek)
(y wy : Int)
(dw : Time.DayOfWeek)
:
Convert from the given kind of "week calendar". ws
is the first day of each week.
Invalid week and day values will be clipped to the correct range.
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Time.fromWeekCalendarValid
(wt : Time.FirstWeekType)
(ws : Time.DayOfWeek)
(y wy : Int)
(dw : Time.DayOfWeek)
:
Equations
- Time.fromWeekCalendarValid wt ws y wy dw = if (Time.toWeekCalendar wt ws (Time.fromWeekCalendar wt ws y wy dw) == (y, wy, dw)) = true then some (Time.fromWeekCalendar wt ws y wy dw) else none
Instances For
Convert from ISO 8601 Week Date format.
- First argument is year,
- second week number (1-52 or 53),
- third day of week (1 for Monday to 7 for Sunday).
Invalid week and day values will be clipped to the correct range.
Equations
Instances For
Convert from ISO 8601 Week Date format.
- First argument is year,
- second week number (1-52 or 53),
- third day of week (1 for Monday to 7 for Sunday).
Invalid week and day values will be clipped to the correct range.
Equations
- One or more equations did not get rendered due to their size.