| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Week-based calendars
Year of Common Era (when positive).
type WeekOfYear = Int Source
Week of year, by various reckonings, generally in range 0-53 depending on reckoning.
| NFData DayOfWeek Source | |||||
Defined in Data.Time.Calendar.Week | |||||
| Data DayOfWeek Source | |||||
Defined in Data.Time.Calendar.Week Methodsgfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DayOfWeek -> c DayOfWeek gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DayOfWeek toConstr :: DayOfWeek -> Constr dataTypeOf :: DayOfWeek -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DayOfWeek) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DayOfWeek) gmapT :: (forall b. Data b => b -> b) -> DayOfWeek -> DayOfWeek gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DayOfWeek -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DayOfWeek -> r gmapQ :: (forall d. Data d => d -> u) -> DayOfWeek -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> DayOfWeek -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> DayOfWeek -> m DayOfWeek gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DayOfWeek -> m DayOfWeek gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DayOfWeek -> m DayOfWeek | |||||
| Enum DayOfWeek Source | "Circular", so for example |
||||
Defined in Data.Time.Calendar.Week | |||||
| Generic DayOfWeek Source | |||||
Defined in Data.Time.Calendar.Week Associated Types
| |||||
| Ix DayOfWeek Source | |||||
Defined in Data.Time.Calendar.Week Methodsrange :: (DayOfWeek, DayOfWeek) -> [DayOfWeek] index :: (DayOfWeek, DayOfWeek) -> DayOfWeek -> Int unsafeIndex :: (DayOfWeek, DayOfWeek) -> DayOfWeek -> Int inRange :: (DayOfWeek, DayOfWeek) -> DayOfWeek -> Bool rangeSize :: (DayOfWeek, DayOfWeek) -> Int unsafeRangeSize :: (DayOfWeek, DayOfWeek) -> Int | |||||
| Read DayOfWeek Source | |||||
| Show DayOfWeek Source | |||||
| Eq DayOfWeek Source | |||||
| Ord DayOfWeek Source | |||||
Defined in Data.Time.Calendar.Week | |||||
| FormatTime DayOfWeek Source | |||||
Defined in Data.Time.Format.Format.Instances MethodsformatCharacter :: Bool -> Char -> Maybe (FormatOptions -> DayOfWeek -> String) Source | |||||
| Lift DayOfWeek Source | |||||
| type Rep DayOfWeek Source | |||||
Defined in Data.Time.Calendar.Week type Rep DayOfWeek = D1 ('MetaData "DayOfWeek" "Data.Time.Calendar.Week" "time-1.14-40b8" 'False) ((C1 ('MetaCons "Monday" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Tuesday" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Wednesday" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Thursday" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Friday" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Saturday" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Sunday" 'PrefixI 'False) (U1 :: Type -> Type)))) | |||||
dayOfWeek :: Day -> DayOfWeek Source
data FirstWeekType Source
| FirstWholeWeek | first week is the first whole week of the year |
| FirstMostWeek | first week is the first week with four days in the year |
| Eq FirstWeekType Source | |
Defined in Data.Time.Calendar.WeekDate Methods(==) :: FirstWeekType -> FirstWeekType -> Bool (/=) :: FirstWeekType -> FirstWeekType -> Bool | |
| Lift FirstWeekType Source | |
Defined in Data.Time.Calendar.WeekDate Methodslift :: Quote m => FirstWeekType -> m Exp liftTyped :: forall (m :: Type -> Type). Quote m => FirstWeekType -> Code m FirstWeekType | |
| :: FirstWeekType | how to reckon the first week of the year |
| -> DayOfWeek | the first day of each week |
| -> Day | |
| -> (Year, WeekOfYear, DayOfWeek) |
Convert to the given kind of "week calendar". Note that the year number matches the weeks, and so is not always the same as the Gregorian year number.
| :: FirstWeekType | how to reckon the first week of the year |
| -> DayOfWeek | the first day of each week |
| -> Year | |
| -> WeekOfYear | |
| -> DayOfWeek | |
| -> Day |
Convert from the given kind of "week calendar". Invalid week and day values will be clipped to the correct range.
| :: FirstWeekType | how to reckon the first week of the year |
| -> DayOfWeek | the first day of each week |
| -> Year | |
| -> WeekOfYear | |
| -> DayOfWeek | |
| -> Maybe Day |
Convert from the given kind of "week calendar". Invalid week and day values will return Nothing.
toWeekDate :: Day -> (Year, WeekOfYear, Int) Source
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.
fromWeekDate :: Year -> WeekOfYear -> Int -> Day Source
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.
pattern YearWeekDay :: Year -> WeekOfYear -> DayOfWeek -> Day Source
Bidirectional abstract constructor for ISO 8601 Week Date format. Invalid week values will be clipped to the correct range.
fromWeekDateValid :: Year -> WeekOfYear -> Int -> Maybe Day Source
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.
showWeekDate :: Day -> String Source
Show in ISO 8601 Week Date format as yyyy-Www-d (e.g. "2006-W46-3").
© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/9.12.1/docs/libraries/time-1.14-40b8/Data-Time-Calendar-WeekDate.html