Ordinal
represents a bounded value for months, which ranges between 1 and 12.
Equations
Equations
- Std.Time.Month.instOfNatOrdinal = inferInstanceAs (OfNat (Std.Time.Internal.Bounded.LE 1 (1 + ↑11)) n)
Equations
- Std.Time.Month.instInhabitedOrdinal = { default := 1 }
Equations
Equations
Offset
represents an offset in months. It is defined as an Int
.
Equations
Instances For
- Std.Time.Month.instOfNatOffset
- Std.Time.Month.instOffsetAdd
- Std.Time.Month.instOffsetBEq
- Std.Time.Month.instOffsetDiv
- Std.Time.Month.instOffsetInhabited
- Std.Time.Month.instOffsetLE
- Std.Time.Month.instOffsetLT
- Std.Time.Month.instOffsetMul
- Std.Time.Month.instOffsetNeg
- Std.Time.Month.instOffsetRepr
- Std.Time.Month.instOffsetSub
- Std.Time.Month.instOffsetToString
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
- Std.Time.Month.instOfNatOffset = { ofNat := Int.ofNat n }
Quarter
represents a value between 1 and 4, inclusive, corresponding to the four quarters of a year.
Equations
Determine the Quarter
by the month.
Equations
- Std.Time.Month.Quarter.ofMonth month = ((Std.Time.Internal.Bounded.LE.sub month 1).ediv 3 Std.Time.Month.Quarter.ofMonth.proof_1).add 1
Creates an Offset
from a natural number.
Equations
- Std.Time.Month.Offset.ofNat data = Int.ofNat data
The ordinal value representing the month of January.
Equations
The ordinal value representing the month of February.
Equations
The ordinal value representing the month of March.
Equations
The ordinal value representing the month of April.
Equations
The ordinal value representing the month of May.
Equations
The ordinal value representing the month of June.
Equations
The ordinal value representing the month of July.
Equations
The ordinal value representing the month of August.
Equations
The ordinal value representing the month of September.
Equations
The ordinal value representing the month of October.
Equations
The ordinal value representing the month of November.
Equations
The ordinal value representing the month of December.
Equations
Creates an Ordinal
from an integer, ensuring the value is within bounds.
Equations
- Std.Time.Month.Ordinal.ofInt data h = Std.Time.Internal.Bounded.LE.mk data h
Creates an Ordinal
from a Nat
, ensuring the value is within bounds.
Equations
- Std.Time.Month.Ordinal.ofNat data h = Std.Time.Internal.Bounded.LE.ofNat' data h
Converts a Ordinal
into a Nat
.
Equations
- Std.Time.Month.Ordinal.toNat ⟨Int.ofNat s, property⟩ = s
- Std.Time.Month.Ordinal.toNat ⟨Int.negSucc s, h⟩ = nomatch ⋯
Transforms Month.Ordinal
into Second.Offset
.
Equations
- One or more equations did not get rendered due to their size.
Transforms Month.Ordinal
into Minute.Offset
.
Equations
- Std.Time.Month.Ordinal.toMinutes leap month = Std.Time.Internal.UnitVal.ediv (Std.Time.Month.Ordinal.toSeconds leap month) 60
Transforms Month.Ordinal
into Hour.Offset
.
Equations
- Std.Time.Month.Ordinal.toHours leap month = Std.Time.Internal.UnitVal.ediv (Std.Time.Month.Ordinal.toMinutes leap month) 60
Transforms Month.Ordinal
into Day.Offset
.
Equations
- Std.Time.Month.Ordinal.toDays leap month = Std.Time.Internal.UnitVal.convert (Std.Time.Month.Ordinal.toSeconds leap month)
Gets the number of days in a month.
Equations
- One or more equations did not get rendered due to their size.
Returns the number of days until the month
.
Equations
- One or more equations did not get rendered due to their size.
Checks if a given day is valid for the specified month and year. For example, 29/02
is valid only
if the year is a leap year.
Equations
- Std.Time.Month.Ordinal.Valid leap month day = (day.val ≤ (Std.Time.Month.Ordinal.days leap month).val)
Clips the day to be within the valid range.
Equations
- Std.Time.Month.Ordinal.clipDay leap month day = if day.val > (Std.Time.Month.Ordinal.days leap month).val then Std.Time.Month.Ordinal.days leap month else day
Proves that every value provided by a clipDay is a valid day in a year.