- common: Time.Icc 1 365 → Time.DayOfYear
- leap: Time.Icc 1 366 → Time.DayOfYear
Instances For
Equations
- Time.instReprDayOfYear = { reprPrec := Time.reprDayOfYear✝ }
Equations
- Time.instBEqDayOfYear = { beq := Time.beqDayOfYear✝ }
Equations
- One or more equations did not get rendered due to their size.
Equations
- Time.instCoeDayOfYearIccOfNat = { coe := fun (x : Time.DayOfYear) => match x with | Time.DayOfYear.common d => ⟨d.val, ⋯⟩ | Time.DayOfYear.leap d => d }
ISO 8601 Ordinal Date
- year : Int
- dayOfYear : Time.DayOfYear
- isValid : match self.dayOfYear with | Time.DayOfYear.common a => Time.isLeapYear self.year = false | Time.DayOfYear.leap a => Time.isLeapYear self.year = true
Instances For
Equations
- Time.instReprOrdinalDate = { reprPrec := Time.reprOrdinalDate✝ }
Equations
- Time.instBEqOrdinalDate = { beq := fun (a b : Time.OrdinalDate) => a.year == b.year && decide ((a.dayOfYear == b.dayOfYear) = true) }
Equations
- Time.dayOfYear dayOfYear = match dayOfYear with | Time.DayOfYear.common d => d.val | Time.DayOfYear.leap d => d.val
Instances For
from modified Julian day to year and day of year
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Time.instReprYearBase = { reprPrec := Time.reprYearBase✝ }
Equations
- Time.instBEqYearBase = { beq := Time.beqYearBase✝ }
Equations
- Time.firstDayOfYear year = if Time.isLeapYear year = true then Time.DayOfYear.leap ⟨1, Time.firstDayOfYear.proof_1⟩ else Time.DayOfYear.common ⟨1, Time.firstDayOfYear.proof_2⟩
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Convert from ISO 8601 Ordinal Date format. Invalid day numbers will be clipped to the correct range (1 to 365 or 366).
Equations
- Time.fromOrdinalDayOfYear year d = let day' := Time.clipDayOfYear Time.YearBase.One year ↑d.val; { modifiedJulianDay := Time.toModifiedJulianDay year day' }
Instances For
Convert from ISO 8601 Ordinal Date format. Invalid day numbers will be clipped to the correct range (1 to 365 or 366).
Equations
- Time.fromOrdinalDate dt = Time.fromOrdinalDayOfYear dt.year (match dt.dayOfYear with | Time.DayOfYear.common d => ⟨d.val, ⋯⟩ | Time.DayOfYear.leap d => d)
Instances For
Convert from ISO 8601 Ordinal Date format.
Equations
- Time.fromOrdinalDateValid year day = do let day' ← Time.clipDayOfYearValid Time.YearBase.One year day pure { modifiedJulianDay := Time.toModifiedJulianDay year day' }
Instances For
The inverse of 'mondayStartWeek'. Get a 'Day' given the year, the number of the Monday-starting week, and the day of the week. The first Monday is the first day of week 1, any earlier days in the year are week 0 (as @%W@ in 'Data.Time.Format.formatTime').
Equations
- One or more equations did not get rendered due to their size.
Instances For
The inverse of 'sundayStartWeek'. Get a 'Day' given the year and the number of the day of a Sunday-starting week. The first Sunday is the first day of week 1, any earlier days in the year are week 0 (as @%U@ in 'Data.Time.Format.formatTime').
Equations
- One or more equations did not get rendered due to their size.