Data.Time.Calendar.OrdinalDate

time-1.8.0.2: A time library

Safe Haskell | Safe
Language | Haskell2010

Data.Time.Calendar.OrdinalDate

Description

ISO 8601 Ordinal Date format

Synopsis

- toOrdinalDate :: Day -> (Integer, Int)
- toOrdinalDate :: Day -> (Integer, Int)
- fromOrdinalDate :: Integer -> Int -> Day
- fromOrdinalDate :: Integer -> Int -> Day
- fromOrdinalDateValid :: Integer -> Int -> Maybe Day
- fromOrdinalDateValid :: Integer -> Int -> Maybe Day
- showOrdinalDate :: Day -> String
- showOrdinalDate :: Day -> String
- isLeapYear :: Integer -> Bool
- isLeapYear :: Integer -> Bool
- mondayStartWeek :: Day -> (Int, Int)
- mondayStartWeek :: Day -> (Int, Int)
- sundayStartWeek :: Day -> (Int, Int)
- sundayStartWeek :: Day -> (Int, Int)
- fromMondayStartWeek :: Integer -> Int -> Int -> Day
- fromMondayStartWeek :: Integer -> Int -> Int -> Day
- fromMondayStartWeekValid :: Integer -> Int -> Int -> Maybe Day
- fromMondayStartWeekValid :: Integer -> Int -> Int -> Maybe Day
- fromSundayStartWeek :: Integer -> Int -> Int -> Day
- fromSundayStartWeek :: Integer -> Int -> Int -> Day
- fromSundayStartWeekValid :: Integer -> Int -> Int -> Maybe Day
- fromSundayStartWeekValid :: Integer -> Int -> Int -> Maybe Day

# Documentation

toOrdinalDate :: Day -> (Integer, Int) Source #

Convert to ISO 8601 Ordinal Date format. First element of result is year (proleptic Gregoran calendar), second is the day of the year, with 1 for Jan 1, and 365 (or 366 in leap years) for Dec 31.

toOrdinalDate :: Day -> (Integer, Int) Source #

Convert to ISO 8601 Ordinal Date format. First element of result is year (proleptic Gregoran calendar), second is the day of the year, with 1 for Jan 1, and 365 (or 366 in leap years) for Dec 31.

fromOrdinalDate :: Integer -> Int -> Day Source #

Convert from ISO 8601 Ordinal Date format. Invalid day numbers will be clipped to the correct range (1 to 365 or 366).

fromOrdinalDate :: Integer -> Int -> Day Source #

Convert from ISO 8601 Ordinal Date format. Invalid day numbers will be clipped to the correct range (1 to 365 or 366).

fromOrdinalDateValid :: Integer -> Int -> Maybe Day Source #

Convert from ISO 8601 Ordinal Date format. Invalid day numbers return `Nothing`

fromOrdinalDateValid :: Integer -> Int -> Maybe Day Source #

Convert from ISO 8601 Ordinal Date format. Invalid day numbers return `Nothing`

showOrdinalDate :: Day -> String Source #

Show in ISO 8601 Ordinal Date format (yyyy-ddd)

showOrdinalDate :: Day -> String Source #

Show in ISO 8601 Ordinal Date format (yyyy-ddd)

isLeapYear :: Integer -> Bool Source #

Is this year a leap year according to the proleptic Gregorian calendar?

isLeapYear :: Integer -> Bool Source #

Is this year a leap year according to the proleptic Gregorian calendar?

mondayStartWeek :: Day -> (Int, Int) Source #

Get the number of the Monday-starting week in the year and the day of the week. The first Monday is the first day of week 1, any earlier days in the year are week 0 (as `%W` in `formatTime`). Monday is 1, Sunday is 7 (as `%u` in `formatTime`).

mondayStartWeek :: Day -> (Int, Int) Source #

Get the number of the Monday-starting week in the year and the day of the week. The first Monday is the first day of week 1, any earlier days in the year are week 0 (as `%W` in `formatTime`). Monday is 1, Sunday is 7 (as `%u` in `formatTime`).

sundayStartWeek :: Day -> (Int, Int) Source #

Get the number of the Sunday-starting week in the year and the day of the week. The first Sunday is the first day of week 1, any earlier days in the year are week 0 (as `%U` in `formatTime`). Sunday is 0, Saturday is 6 (as `%w` in `formatTime`).

sundayStartWeek :: Day -> (Int, Int) Source #

Get the number of the Sunday-starting week in the year and the day of the week. The first Sunday is the first day of week 1, any earlier days in the year are week 0 (as `%U` in `formatTime`). Sunday is 0, Saturday is 6 (as `%w` in `formatTime`).

fromMondayStartWeek Source #

Arguments

:: Integer | Year.
-> Int | Monday-starting week number (as `%W` in `formatTime`).
-> Int | Day of week. Monday is 1, Sunday is 7 (as `%u` in `formatTime`).
-> Day |

The inverse of `mondayStartWeek`. Get a `Day` given the year, the number of the Monday-starting week, and the day of the week. The first Monday is the first day of week 1, any earlier days in the year are week 0 (as `%W` in `formatTime`).

fromMondayStartWeek Source #

Arguments

:: Integer | Year.
-> Int | Monday-starting week number (as `%W` in `formatTime`).
-> Int | Day of week. Monday is 1, Sunday is 7 (as `%u` in `formatTime`).
-> Day |

The inverse of `mondayStartWeek`. Get a `Day` given the year, the number of the Monday-starting week, and the day of the week. The first Monday is the first day of week 1, any earlier days in the year are week 0 (as `%W` in `formatTime`).

fromMondayStartWeekValid Source #

Arguments

:: Integer | Year.
-> Int | Monday-starting week number (as `%W` in `formatTime`).
-> Int | Day of week. Monday is 1, Sunday is 7 (as `%u` in `formatTime`).
-> Maybe Day |

fromMondayStartWeekValid Source #

Arguments

:: Integer | Year.
-> Int | Monday-starting week number (as `%W` in `formatTime`).
-> Int | Day of week. Monday is 1, Sunday is 7 (as `%u` in `formatTime`).
-> Maybe Day |

fromSundayStartWeek Source #

Arguments

:: Integer | Year.
-> Int | Sunday-starting week number (as `%U` in `formatTime`).
-> Int | Day of week Sunday is 0, Saturday is 6 (as `%w` in `formatTime`).
-> Day |

The inverse of `sundayStartWeek`. Get a `Day` given the year and the number of the day of a Sunday-starting week. The first Sunday is the first day of week 1, any earlier days in the year are week 0 (as `%U` in `formatTime`).

fromSundayStartWeek Source #

Arguments

:: Integer | Year.
-> Int | Sunday-starting week number (as `%U` in `formatTime`).
-> Int | Day of week Sunday is 0, Saturday is 6 (as `%w` in `formatTime`).
-> Day |

The inverse of `sundayStartWeek`. Get a `Day` given the year and the number of the day of a Sunday-starting week. The first Sunday is the first day of week 1, any earlier days in the year are week 0 (as `%U` in `formatTime`).

fromSundayStartWeekValid Source #

Arguments

:: Integer | Year.
-> Int | Sunday-starting week number (as `%U` in `formatTime`).
-> Int | Day of week. Sunday is 0, Saturday is 6 (as `%w` in `formatTime`).
-> Maybe Day |

fromSundayStartWeekValid Source #

Arguments

:: Integer | Year.
-> Int | Sunday-starting week number (as `%U` in `formatTime`).
-> Int | Day of week. Sunday is 0, Saturday is 6 (as `%w` in `formatTime`).
-> Maybe Day |