Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
Month
data type.
Synopsis
- data Month
- data YearMonth = YearMonth {}
- dayToYearMonth :: Day -> YearMonth
- firstDayOfYearMonth :: YearMonth -> Day
- lastDayOfYearMonth :: YearMonth -> Day
- yearMonthInterval :: YearMonth -> Interval Day
- yearMonthToText :: YearMonth -> Text
- parseYearMonth :: Text -> Either String YearMonth
Types
We explicitly enumerate month names. Using an Int
is unsafe.
Instances
A month in Julian/Gregorian calendar.
Instances
Conversion with Day
dayToYearMonth :: Day -> YearMonth Source #
firstDayOfYearMonth :: YearMonth -> Day Source #
First day of the month.
>>>
firstDayOfYearMonth $ YearMonth 2017 February
2017-02-01
lastDayOfYearMonth :: YearMonth -> Day Source #
Last day of the month
>>>
lastDayOfYearMonth $ YearMonth 2017 February
2017-02-28
>>>
lastDayOfYearMonth $ YearMonth 2016 February
2016-02-29
yearMonthInterval :: YearMonth -> Interval Day Source #
Day interval of month
>>>
yearMonthInterval $ YearMonth 2017 February
2017-02-01 ... 2017-02-28
Conversions with Text
yearMonthToText :: YearMonth -> Text Source #