- 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.instCoeIccOfNat = { coe := fun (d : Time.Icc 1 365) => ⟨d.val, ⋯⟩ }
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
- One or more equations did not get rendered due to their size.
Equations
- Time.dayOfYear (Time.DayOfYear.common a) = a.val
- Time.dayOfYear (Time.DayOfYear.leap a) = a.val
Instances For
Equations
- One or more equations did not get rendered due to their size.
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.clipDayOfYear Time.YearBase.Zero year dayOfYear = Time.Clip.clip 0 (if Time.isLeapYear year = true then 365 else 364) dayOfYear ⋯
- Time.clipDayOfYear Time.YearBase.One year dayOfYear = Time.Clip.clip 1 (if Time.isLeapYear year = true then 366 else 365) dayOfYear ⋯
Instances For
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 = { modifiedJulianDay := Time.toModifiedJulianDay year (Time.clipDayOfYear Time.YearBase.One year ↑d.val) }
Instances For
Convert from ISO 8601 Ordinal Date format.
Equations
- Time.fromOrdinalDate dt = { modifiedJulianDay := Time.toModifiedJulianDay dt.year (Time.dayOfYear dt.dayOfYear) }
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.