Modulererebase-1.21.2Haskell2010
Data.Time.Calendar
- 6 types
- 1 class
- 32 values
- Packagererebase-1.21.2
- Exports54
- LanguageHaskell2010
- LicenceMIT
- SourceCalendarDiffDays.hs
Scale by a factor. Note that scaleCalendarDiffDays (-1) will not perfectly invert a duration, due to variable month lengths.
A list of all the days in this period.
Get the period this day is in, with the 1-based day number within the period.
periodFromDay (periodFirstDay p) = (p,1)The number of days in this period.
Inverse of periodFromDay.
Validating inverse of periodFromDay.
Bidirectional abstract constructor for the proleptic Gregorian calendar. Invalid values will be clipped to the correct range, month first, then day.
Add months (clipped to last day), then add days
Add months (rolling over to next month), then add days
Add months, with days past the last day of the month clipped to the last day. For instance, 2005-01-30 + 1 month = 2005-02-28.
Add months, with days past the last day of the month rolling over to the next month. For instance, 2005-01-30 + 1 month = 2005-03-02.
Add years, matching month and day, with Feb 29th clipped to Feb 28th if necessary. For instance, 2004-02-29 + 2 years = 2006-02-28.
Add years, matching month and day, with Feb 29th rolled over to Mar 1st if necessary. For instance, 2004-02-29 + 2 years = 2006-03-01.
Calendrical difference, with as many whole months as possible
Calendrical difference, with as many whole months as possible. Same as diffGregorianDurationClip for positive durations.
Convert from proleptic Gregorian calendar. Invalid values will be clipped to the correct range, month first, then day.
Convert from proleptic Gregorian calendar. Invalid values will return Nothing
The number of days in a given month according to the proleptic Gregorian calendar.
Show in ISO 8601 format (yyyy-mm-dd)
Convert to proleptic Gregorian calendar.
Is this year a leap year according to the proleptic Gregorian calendar?
Also known as Before Christ.
Note that Year 1 = 1 CE, and the previous Year 0 = 1 BCE.
CommonEra and BeforeCommonEra form a COMPLETE set.
Also known as Anno Domini.
The twelve MonthOfYear patterns form a COMPLETE set.
dayOfWeekDiff a b = a - b in range 0 to 6.
The number of days from b to the next a.
The first day-of-week on or after some day
Returns a week containing the given Day where the first day is the DayOfWeek specified.
Examples:
weekAllDays Sunday (YearMonthDay 2022 02 21)[YearMonthDay 2022 2 20 .. YearMonthDay 2022 2 26]
weekAllDays Monday (YearMonthDay 2022 02 21)[YearMonthDay 2022 2 21 .. YearMonthDay 2022 2 27]
weekAllDays Tuesday (YearMonthDay 2022 02 21)[YearMonthDay 2022 2 15 .. YearMonthDay 2022 2 21]
Returns the first day of a week containing the given Day.
Examples:
weekFirstDay Sunday (YearMonthDay 2022 02 21)YearMonthDay 2022 2 20
weekFirstDay Monday (YearMonthDay 2022 02 21)YearMonthDay 2022 2 21
weekFirstDay Tuesday (YearMonthDay 2022 02 21)YearMonthDay 2022 2 15
Returns the last day of a week containing the given Day.
Examples:
weekLastDay Sunday (YearMonthDay 2022 02 21)YearMonthDay 2022 2 26
weekLastDay Monday (YearMonthDay 2022 02 21)YearMonthDay 2022 2 27
weekLastDay Tuesday (YearMonthDay 2022 02 21)YearMonthDay 2022 2 21
Constructors
Instances12Eq, Data, Show, Generic, Semigroup, Monoid, …
Eq CalendarDiffDaysDefined in time-1.12.2 · Data.Time.Calendar.CalendarDiffDaysData CalendarDiffDaysDefined in time-1.12.2 · Data.Time.Calendar.CalendarDiffDaysShow CalendarDiffDaysDefined in time-1.12.2 · Data.Time.Calendar.CalendarDiffDaysGeneric CalendarDiffDaysDefined in time-compat-1.9.8 · Data.Time.Orphans · orphanSemigroup CalendarDiffDaysDefined in time-1.12.2 · Data.Time.Calendar.CalendarDiffDaysAdditive
Monoid CalendarDiffDaysDefined in time-1.12.2 · Data.Time.Calendar.CalendarDiffDaysAdditive
NFData CalendarDiffDaysDefined in time-1.12.2 · Data.Time.Calendar.CalendarDiffDaysFormatTime CalendarDiffDaysDefined in time-1.12.2 · Data.Time.Format.Format.Instances · orphanParseTime CalendarDiffDaysDefined in time-1.12.2 · Data.Time.Format.Parse.Instances · orphanISO8601 CalendarDiffDaysDefined in time-1.12.2 · Data.Time.Format.ISO8601PyYmMdD(ISO 8601:2004(E) sec. 4.4.3.2)Lift CalendarDiffDaysDefined in time-compat-1.9.8 · Data.Time.Orphans · orphantype Rep CalendarDiffDays = D1 ('MetaDataDefined in time-compat-1.9.8 · Data.Time.Orphans · orphan"CalendarDiffDays"
"Data.Time.Calendar.CalendarDiffDays"
"time-1.12.2-cfd2"
'False) (C1 ('MetaCons"CalendarDiffDays"
'PrefixI 'True) (S1 ('MetaSel ('Just"cdMonths"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer) :*: S1 ('MetaSel ('Just"cdDays"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)))
The Modified Julian Day is a standard count of days, with zero being the day 1858-11-17.
Constructors
Instances16Enum, Eq, Data, Ord, Read, Show, …
Enum DayDefined in time-1.12.2 · Data.Time.Calendar.DaysEq DayDefined in time-1.12.2 · Data.Time.Calendar.DaysData DayDefined in time-1.12.2 · Data.Time.Calendar.DaysOrd DayDefined in time-1.12.2 · Data.Time.Calendar.DaysRead DayDefined in time-1.12.2 · Data.Time.Format.Parse · orphanShow DayDefined in time-1.12.2 · Data.Time.Calendar.Gregorian · orphanIx DayDefined in time-1.12.2 · Data.Time.Calendar.DaysGeneric DayDefined in time-compat-1.9.8 · Data.Time.Orphans · orphanNFData DayDefined in time-1.12.2 · Data.Time.Calendar.DaysHashable DayDefined in time-compat-1.9.8 · Data.Time.Orphans · orphanDayPeriod DayDefined in time-1.12.2 · Data.Time.Calendar.DaysFormatTime DayDefined in time-1.12.2 · Data.Time.Format.Format.Instances · orphanParseTime DayDefined in time-1.12.2 · Data.Time.Format.Parse.Instances · orphanISO8601 DayDefined in time-1.12.2 · Data.Time.Format.ISO8601yyyy-mm-dd(ISO 8601:2004(E) sec. 4.1.2.2 extended format)Lift DayDefined in time-compat-1.9.8 · Data.Time.Orphans · orphantype Rep Day = D1 ('MetaDataDefined in time-compat-1.9.8 · Data.Time.Orphans · orphan"Day"
"Data.Time.Calendar.Days"
"time-1.12.2-cfd2"
'True) (C1 ('MetaCons"ModifiedJulianDay"
'PrefixI 'True) (S1 ('MetaSel ('Just"toModifiedJulianDay"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)))
The class of types which can be represented as a period of days.
Methods
periodFirstDay :: p -> DayReturns the first Day in a period of days.
periodLastDay :: p -> DayReturns the last Day in a period of days.
dayPeriod :: Day -> pGet the period this day is in.
Day of month, in range 1 to 31.
Month of year, in range 1 (January) to 12 (December).
Year of Common Era (when positive).
Instances11Enum, Eq, Data, Ord, Read, Show, …
Enum DayOfWeekDefined in time-1.12.2 · Data.Time.Calendar.WeekEq DayOfWeekDefined in time-1.12.2 · Data.Time.Calendar.WeekData DayOfWeekDefined in time-1.12.2 · Data.Time.Calendar.WeekOrd DayOfWeekDefined in time-1.12.2 · Data.Time.Calendar.WeekRead DayOfWeekDefined in time-1.12.2 · Data.Time.Calendar.WeekShow DayOfWeekDefined in time-1.12.2 · Data.Time.Calendar.WeekIx DayOfWeekDefined in time-1.12.2 · Data.Time.Calendar.WeekNFData DayOfWeekDefined in time-1.12.2 · Data.Time.Calendar.WeekHashable DayOfWeekDefined in time-compat-1.9.8 · Data.Time.Orphans · orphanFormatTime DayOfWeekDefined in time-1.12.2 · Data.Time.Format.Format.Instances · orphanLift DayOfWeekDefined in time-compat-1.9.8 · Data.Time.Orphans · orphan