HORIZON HASKELLDocslts/ghc-10.0.x8174fa42026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11

Moduletime-1.16.0.1GHC2021

Data.Time.Calendar.WeekDate

Week-based calendars

  • 4 types
  • 8 values
  • Packagetime-1.16.0.1
  • Exports13
  • LanguageGHC2021
  • LicenceBSD-2-Clause
  • SourceWeekDate.hs
typetype Year = Integer
#

Year of Common Era (when positive).

typetype WeekOfYear = Int
#

Week of year, by various reckonings, generally in range 0-53 depending on reckoning.

datadata DayOfWeek
#
Instances13Enum, Eq, Data, Ord, Read, Show, …

ISO 8601 Week Date format

5 declarations
valuetoWeekDate :: Day -> (Year, WeekOfYear, Int)
#

Convert to ISO 8601 Week Date format. First element of result is year, second week number (1-53), third day of week (1 for Monday to 7 for Sunday). Note that "Week" years are not quite the same as Gregorian years, as the first day of the year is always a Monday. The first week of a year is the first week to contain at least four days in the corresponding Gregorian year.

valuefromWeekDate :: Year -> WeekOfYear -> Int -> Day
#

Convert from ISO 8601 Week Date format. First argument is year, second week number (1-52 or 53), third day of week (1 for Monday to 7 for Sunday). Invalid week and day values will be clipped to the correct range.

patternpattern YearWeekDay :: Year -> WeekOfYear -> DayOfWeek -> Day
#

Bidirectional abstract constructor for ISO 8601 Week Date format. Invalid week values will be clipped to the correct range.

Convert from ISO 8601 Week Date format. First argument is year, second week number (1-52 or 53), third day of week (1 for Monday to 7 for Sunday). Invalid week and day values will return Nothing.