| Copyright | (C) 2017 Jason Johnson |
|---|---|
| License | BSD-style (see the file LICENSE) |
| Maintainer | Jason Johnson <jason.johnson.081@gmail.com> |
| Stability | experimental |
| Portability | POSIX, Windows |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Data.HodaTime.Calendar.Julian
Contents
Description
This is the module for CalendarDate and CalendarDateTime in the Julian calendar. The Julian calendar has a simple leap year rule - every fourth year is a leap year, with none of the century
exceptions that Gregorian later added to keep the calendar aligned to the solar year. Years use astronomical numbering, so year 1 is AD 1, year 0 is 1 BC, year -1 is 2 BC
and so on; dates run from the calendar's introduction on 1.January.45 BC (year -44) onward, with no upper bound. Dates share the same absolute timeline as every other calendar, so in the modern era
a Julian date reads 13 days behind the same instant's Gregorian date. The Julian calendar is not merely historical - the Eastern Orthodox churches still use it liturgically, so it stays useful for
both past dates and current and future feast-day calculations.
Proleptic every-fourth-year rule
This implementation applies the clean every-fourth-year rule uniformly from 45 BC onward. It deliberately does not reproduce the calendar's messy early history, in which the priests who administered it inserted a leap day every three years by mistake (the "triennial error") until Augustus suspended leap years to realign it, the regular rule only settling in by around AD 8. We omit that for two reasons:
- The exact sequence of long years during 45 BC - AD 7 is genuinely disputed: Scaliger, Ideler and Bennett each reconstruct it differently, so an "accurate" version would just bake one contested interpretation in as fact.
- By long-standing convention historians and astronomers already cite ancient dates in the proleptic Julian calendar (the clean rule), precisely because the real sequence is uncertain. For example "15.March.44 BC" for Caesar's assassination is a proleptic Julian date; modelling the errors would make this library disagree with the way such dates are normally written.
Synopsis
- calendarDate :: DayOfMonth -> Month Julian -> Year -> Maybe (CalendarDate Julian)
- fromNthDay :: DayNth -> DayOfWeek Julian -> Month Julian -> Year -> Maybe (CalendarDate Julian)
- fromWeekDate :: WeekNumber -> DayOfWeek Julian -> Year -> Maybe (CalendarDate Julian)
- data family Month cal
- data family DayOfWeek cal
- data Julian
Constructors
calendarDate :: DayOfMonth -> Month Julian -> Year -> Maybe (CalendarDate Julian) Source #
Smart constructor for a Julian calendar date.
fromNthDay :: DayNth -> DayOfWeek Julian -> Month Julian -> Year -> Maybe (CalendarDate Julian) Source #
fromWeekDate :: WeekNumber -> DayOfWeek Julian -> Year -> Maybe (CalendarDate Julian) Source #
Smart constructor for a Julian calendar date given as a week date. Note that this method assumes weeks start on Sunday and the first week of the year is the one
which has at least one day in the new year.
Types
data family Month cal Source #
Instances
data family DayOfWeek cal Source #