Defines the different eras.
- bce : Std.Time.Year.Era
The era before the Common Era (BCE), always represents a date before year 0.
- ce : Std.Time.Year.Era
The Common Era (CE), represents dates from year 0 onwards.
Instances For
Equations
- Std.Time.Year.instReprEra = { reprPrec := Std.Time.Year.reprEra✝ }
Equations
- Std.Time.Year.instInhabitedEra = { default := Std.Time.Year.Era.bce }
Equations
- Std.Time.Year.instToStringEra = { toString := fun (x : Std.Time.Year.Era) => match x with | Std.Time.Year.Era.bce => "BCE" | Std.Time.Year.Era.ce => "CE" }
Equations
- Std.Time.Year.instOffsetBEq = instBEqOfDecidableEq
Equations
- Std.Time.Year.instDecidableLeOffset = inferInstanceAs (Decidable (x ≤ y))
Equations
- Std.Time.Year.instDecidableLtOffset = inferInstanceAs (Decidable (x < y))
@[inline]
Creates an Offset
from a natural number.
Equations
- Std.Time.Year.Offset.ofNat data = Int.ofNat data
Instances For
@[inline]
Creates an Offset
from an integer.
Equations
- Std.Time.Year.Offset.ofInt data = data
Instances For
@[inline]
Converts the Year
offset to a Month
offset.
Instances For
Returns the Era
of the Year
.
Equations
- year.era = if year.toInt ≥ 1 then Std.Time.Year.Era.ce else Std.Time.Year.Era.bce
Instances For
Calculates the number of days in the specified year
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Calculates the number of weeks in the specified year
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[reducible, inline]
abbrev
Std.Time.Year.Offset.Valid
(year : Std.Time.Year.Offset)
(month : Std.Time.Month.Ordinal)
(day : Std.Time.Day.Ordinal)
:
Checks if the given date is valid for the specified year, month, and day.
Equations
- year.Valid month day = (day ≤ Std.Time.Month.Ordinal.days year.isLeap month)