| 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.Gregorian
Contents
Description
This is the module for CalendarDate and CalendarDateTime in the Gregorian calendar, the civil calendar used across most of the world today. The Gregorian calendar refines the Julian leap
year rule: every fourth year is a leap year, except that a century year (one divisible by 100) is a leap year only when it is also divisible by 400. Those century exceptions keep the calendar
closely aligned to the solar year and correct the slow drift of Julian (which gains roughly three days every four centuries). Unlike some libraries this calendar is not
proleptic: because the Gregorian calendar first took effect on 15 October 1582 (the day after 4 October 1582 in the Julian calendar, when ten days were dropped) this implementation rejects any
earlier date - use Julian for dates before the changeover. The Gregorian calendar anchors the absolute timeline that every other calendar is measured against, so a given
instant's Gregorian date is the reference that the other calendars are offset from.
Synopsis
- calendarDate :: DayOfMonth -> Month Gregorian -> Year -> Maybe (CalendarDate Gregorian)
- fromNthDay :: DayNth -> DayOfWeek Gregorian -> Month Gregorian -> Year -> Maybe (CalendarDate Gregorian)
- fromWeekDate :: WeekNumber -> DayOfWeek Gregorian -> Year -> Maybe (CalendarDate Gregorian)
- data family Month cal
- data family DayOfWeek cal
- data Gregorian
Constructors
calendarDate :: DayOfMonth -> Month Gregorian -> Year -> Maybe (CalendarDate Gregorian) Source #
fromNthDay :: DayNth -> DayOfWeek Gregorian -> Month Gregorian -> Year -> Maybe (CalendarDate Gregorian) Source #
fromWeekDate :: WeekNumber -> DayOfWeek Gregorian -> Year -> Maybe (CalendarDate Gregorian) Source #
Smart constructor for a Gregorian 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. For ISO compliant behavior use this constructor from the ISO module
Types
data family Month cal Source #
Instances
data family DayOfWeek cal Source #