[
    {
        "name": "Date.Extra",
        "comment": " A `Date` represents a moment in time, encoded by two essential pieces of\ninformation: the number of milliseconds since 1 January 1970 UTC, and the\noffset between UTC and the current machine's local time at that moment.\nExtractions of a `Date` (e.g. `Date.month`, `Date.hour`) return representations\nof the date in local time, while `Date.toTime` returns the UTC representation.\n\n\n# Common constructors\n\n@docs fromParts, fromCalendarDate, fromIsoString\n\n\n# Formatted strings\n\n@docs toFormattedString, toUtcFormattedString, toIsoString, toUtcIsoString\n\n\n# Comparing dates\n\n@docs equal, compare, isBetween, clamp\n\n\n# Intervals\n\nThese functions work on dates within the context of a given interval of time.\n@docs Interval\n\n\n## Comparing\n\n@docs equalBy\n\n\n## Arithmetic\n\n@docs add, diff\n\n\n## Rounding\n\n@docs floor, ceiling\n\n\n## Lists\n\n@docs range\n\n\n# Extractions\n\n@docs monthNumber, quarter, ordinalDay, fractionalDay, weekdayNumber, weekNumber, weekYear, offsetFromUtc\n\n\n# A detailed constructor\n\nIn some cases you may want to specify a date with a known time offset or from\nweek-date or ordinal-date parts. The `fromSpec` function provides a way to\ndo this.\n@docs fromSpec\n\n\n## DateSpec\n\n@docs DateSpec, calendarDate, weekDate, ordinalDate\n\n\n## TimeSpec\n\n@docs TimeSpec, time, midnight\n\n\n## OffsetSpec\n\n@docs OffsetSpec, utc, offset, local\n\n\n# Month and Weekday numbers\n\n@docs monthToNumber, numberToMonth, weekdayToNumber, numberToWeekday\n\n\n# Rata Die\n\n[Rata Die](https://en.wikipedia.org/wiki/Rata_Die) is a system for assigning\nnumbers to calendar days, using a base date of _1 January 0001_. Converting to\nand from Rata Die uses the local representation of a `Date`.\n\n    date = Date.fromCalendarDate 2007 Mar 15\n\n    date\n        |> Date.toRataDie\n        |> Date.fromRataDie\n        |> Date.equal date\n    -- True\n\n@docs toRataDie, fromRataDie\n\n",
        "unions": [
            {
                "name": "DateSpec",
                "comment": " Represents a day.\n",
                "args": [],
                "cases": []
            },
            {
                "name": "Interval",
                "comment": " Represents an interval of time.\n",
                "args": [],
                "cases": [
                    [
                        "Year",
                        []
                    ],
                    [
                        "Quarter",
                        []
                    ],
                    [
                        "Month",
                        []
                    ],
                    [
                        "Week",
                        []
                    ],
                    [
                        "Monday",
                        []
                    ],
                    [
                        "Tuesday",
                        []
                    ],
                    [
                        "Wednesday",
                        []
                    ],
                    [
                        "Thursday",
                        []
                    ],
                    [
                        "Friday",
                        []
                    ],
                    [
                        "Saturday",
                        []
                    ],
                    [
                        "Sunday",
                        []
                    ],
                    [
                        "Day",
                        []
                    ],
                    [
                        "Hour",
                        []
                    ],
                    [
                        "Minute",
                        []
                    ],
                    [
                        "Second",
                        []
                    ],
                    [
                        "Millisecond",
                        []
                    ]
                ]
            },
            {
                "name": "OffsetSpec",
                "comment": " Represents a time offset from UTC.\n",
                "args": [],
                "cases": []
            },
            {
                "name": "TimeSpec",
                "comment": " Represents a time of day.\n",
                "args": [],
                "cases": []
            }
        ],
        "aliases": [],
        "values": [
            {
                "name": "add",
                "comment": " Add a number of whole intervals to a date.\n\n    Date.add Week 2 (Date.fromParts 2007 Mar 15 11 55 0 0)\n    -- <29 March 2007, 11:55>\n\nWhen adding Month, Quarter, or Year intervals, day values are clamped at the\nend of the month if necessary.\n\n    Date.add Month 1 (Date.fromParts 2000 Jan 31 0 0 0 0)\n    -- <29 February 2000>\n\n",
                "type": "Interval -> Int -> Date -> Date"
            },
            {
                "name": "calendarDate",
                "comment": " Create a `DateSpec` from calendar-date parts (year, month, day).\n",
                "type": "Int -> Month -> Int -> DateSpec"
            },
            {
                "name": "ceiling",
                "comment": " Round up a date to the beginning of the closest interval. The resulting\ndate will be greater than or equal to the one provided.\n\n    Date.ceiling Monday\n        (Date.fromParts 1999 Dec 31 23 59 59 999)\n    -- <3 January 2000>\n\n",
                "type": "Interval -> Date -> Date"
            },
            {
                "name": "clamp",
                "comment": " Clamp a date within a given range. The expression `Date.clamp min max x`\nreturns one of `min`, `max`, or `x`, ensuring the returned date is not before\n`min` and not after `max`.\n",
                "type": "Date -> Date -> Date -> Date"
            },
            {
                "name": "compare",
                "comment": " Compare two dates. This can be used as the compare function for\n`List.sortWith`.\n",
                "type": "Date -> Date -> Order"
            },
            {
                "name": "diff",
                "comment": " Find the difference, as a number of whole intervals, between two dates.\n\n    Date.diff Month\n        (Date.fromParts 2007 Mar 15 11 55 0 0)\n        (Date.fromParts 2007 Sep 1 0 0 0 0)\n    -- 5\n\n",
                "type": "Interval -> Date -> Date -> Int"
            },
            {
                "name": "equal",
                "comment": " Test the equality of two dates.\n",
                "type": "Date -> Date -> Bool"
            },
            {
                "name": "equalBy",
                "comment": " Test if two dates fall within the same interval.\n\n    dec31 = Date.fromCalendarDate 1999 Dec 31\n    jan1 = Date.fromCalendarDate 2000 Jan 1\n\n    Date.equalBy Month dec31 jan1 -- False\n    Date.equalBy Week  dec31 jan1 -- True\n\n",
                "type": "Interval -> Date -> Date -> Bool"
            },
            {
                "name": "floor",
                "comment": " Round down a date to the beginning of the closest interval. The resulting\ndate will be less than or equal to the one provided.\n\n    Date.floor Hour\n        (Date.fromParts 1999 Dec 31 23 59 59 999)\n    -- <31 December 1999, 23:00>\n\n",
                "type": "Interval -> Date -> Date"
            },
            {
                "name": "fractionalDay",
                "comment": " Extract the fractional day of a date. Given the date 23 June 1990 at\n11:45 a.m. this returns the float 0.4895833333333333.\n",
                "type": "Date -> Float"
            },
            {
                "name": "fromCalendarDate",
                "comment": " Convenience function for creating a `Date` from only the year, month, and\nday parts. As with `fromParts`, the day is clamped within the range of days in\nthe given month.\n\n    Date.fromCalendarDate 2001 Feb 29\n    -- <28 February 2001>\n\n",
                "type": "Int -> Month -> Int -> Date"
            },
            {
                "name": "fromIsoString",
                "comment": " Attempt to create a `Date` from a string representing a date/time in\n[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.\n\n    Date.fromIsoString \"2000-01-01T00:00:00.000Z\"\n    -- Ok <1 January 2000, UTC>\n\n    Date.fromIsoString \"2000-01-01\"\n    -- Ok <1 January 2000, local time>\n\n    Date.fromIsoString \"1/1/2000\"\n    -- Err \"Invalid ISO 8601 format\"\n\nThe given string must represent a valid date/time; unlike the `fromParts`\nconstructor, any out-of-range parts will fail to produce a `Date`.\n\n    Date.fromIsoString \"2001-02-29\"\n    -- Err \"Invalid calendar date\"\n\nWhen a `Date` is created with a specified time offset (e.g. `\"-03:00\"`), its\nextractions still reflect the current machine's local time, and `Date.toTime`\nstill reflects its UTC time.\n\n    Date.fromIsoString \"2000-01-01T20:00-03:00\"\n    -- Ok <1 January 2000, 23:00, UTC>\n\n",
                "type": "String -> Result String Date"
            },
            {
                "name": "fromParts",
                "comment": " Create a `Date` from the following parts, given in local time:\n\n  - year\n  - month\n  - day\n  - hour\n  - minute\n  - second\n  - millisecond\n\n```\nimport Date exposing (Month(..))\nimport Date.Extra as Date\n\nDate.fromParts 1999 Dec 31 23 59 59 999\n-- <31 December 1999, 23:59:59.999, local time>\n```\n\nOut-of-range parts are clamped.\n\n    Date.fromParts 2001 Feb 29 24 60 60 1000\n    -- <28 February 2001, 23:59:59.999>\n\n",
                "type": "Int -> Month -> Int -> Int -> Int -> Int -> Int -> Date"
            },
            {
                "name": "fromRataDie",
                "comment": " ",
                "type": "Int -> Date"
            },
            {
                "name": "fromSpec",
                "comment": " Create a `Date` from a specified day, time of day, and time offset.\n\n    Date.fromSpec\n        (calendarDate 2000 Jan 1)\n        (time 20 0 0 0)\n        local\n    -- <1 January 2000, 20:00, local time>\n\n    Date.fromSpec\n        (weekDate 2009 1 Mon)\n        midnight\n        utc\n    -- <29 December 2008, UTC>\n\n    Date.fromSpec\n        (ordinalDate 2016 218)\n        (time 20 0 0 0)\n        (offset -180)\n    -- <5 August 2016, 23:00, UTC>\n\nWhen a `Date` is created with a specified time offset (e.g. `offset -180`),\nits extractions still reflect the current machine's local time, and\n`Date.toTime` still reflects its UTC time.\n\n",
                "type": "DateSpec -> TimeSpec -> OffsetSpec -> Date"
            },
            {
                "name": "isBetween",
                "comment": " Test if a date is within a given range, inclusive of the range values. The\nexpression `Date.isBetween min max x` tests if `x` is between `min` and `max`.\n",
                "type": "Date -> Date -> Date -> Bool"
            },
            {
                "name": "local",
                "comment": " Use the local offset.\n",
                "type": "OffsetSpec"
            },
            {
                "name": "midnight",
                "comment": " Convenience value for `time 0 0 0 0`.\n",
                "type": "TimeSpec"
            },
            {
                "name": "monthNumber",
                "comment": " Extract the month number of a date. Given the date 23 June 1990 at\n11:45 a.m. this returns the integer 6.\n",
                "type": "Date -> Int"
            },
            {
                "name": "monthToNumber",
                "comment": "\n\n    monthToNumber Jan -- 1\n\n",
                "type": "Month -> Int"
            },
            {
                "name": "numberToMonth",
                "comment": " Numbers outside the range [1, 12] are clamped.\n\n    numberToMonth -2 -- Jan\n    numberToMonth 15 -- Dec\n\n",
                "type": "Int -> Month"
            },
            {
                "name": "numberToWeekday",
                "comment": " Numbers outside the range [1, 7] are clamped.\n\n    numberToWeekday -2 -- Mon\n    numberToWeekday 10 -- Sun\n\n",
                "type": "Int -> Day"
            },
            {
                "name": "offset",
                "comment": " Use a specific offset from UTC, given in minutes.\n",
                "type": "Int -> OffsetSpec"
            },
            {
                "name": "offsetFromUtc",
                "comment": " Extract the local offset from UTC time, in minutes, of a date. Given a date\nwith a local offset of UTC-05:00 this returns the integer -300.\n",
                "type": "Date -> Int"
            },
            {
                "name": "ordinalDate",
                "comment": " Create a `DateSpec` from ordinal-date parts (year, ordinalDay).\n",
                "type": "Int -> Int -> DateSpec"
            },
            {
                "name": "ordinalDay",
                "comment": " Extract the ordinal day of a date. Given the date 23 June 1990 at\n11:45 a.m. this returns the integer 174.\n",
                "type": "Date -> Int"
            },
            {
                "name": "quarter",
                "comment": " Extract the quarter of a date. Given the date 23 June 1990 at\n11:45 a.m. this returns the integer 2.\n",
                "type": "Date -> Int"
            },
            {
                "name": "range",
                "comment": " Create a list of dates, at rounded intervals, increasing by a step value,\nbetween two dates. The list will start on or after the first date, and end\nbefore the second date.\n\n    Date.range Day 2\n        (Date.fromParts 2007 Mar 15 11 55 0 0)\n        (Date.fromParts 2007 Mar 22 0 0 0 0)\n    -- [ <16 March 2007>\n    -- , <18 March 2007>\n    -- , <20 March 2007>\n    -- ]\n\n",
                "type": "Interval -> Int -> Date -> Date -> List Date"
            },
            {
                "name": "time",
                "comment": " Create a `TimeSpec` from time parts (hour, minute, second, millisecond).\n",
                "type": "Int -> Int -> Int -> Int -> TimeSpec"
            },
            {
                "name": "toFormattedString",
                "comment": " Convert a date to a string using a pattern as a template.\n\n    Date.toFormattedString\n        \"EEEE, MMMM d, y 'at' h:mm a\"\n        (Date.fromParts 2007 Mar 15 13 45 56 67)\n    -- \"Thursday, March 15, 2007 at 1:45 PM\"\n\nEach alphabetic character in the pattern represents date or time information;\nthe number of times a character is repeated specifies the form of the name to\nuse (e.g. \"Tue\", \"Tuesday\") or the padding of numbers (e.g. \"1\", \"01\").\nFormatting characters are escaped within single-quotes; a single-quote is\nescaped as a sequence of two single-quotes, whether appearing inside or outside\nan escaped sequence.\n\nPatterns are based on Date Format Patterns in [Unicode Technical\nStandard #35](http://www.unicode.org/reports/tr35/tr35-43/tr35-dates.html#Date_Format_Patterns).\nOnly the following subset of formatting characters are available:\n\n    \"y\" -- year\n    \"Y\" -- week-numbering year\n    \"Q\" -- quarter\n    \"M\" -- month\n    \"w\" -- week number\n    \"d\" -- day\n    \"D\" -- ordinal day\n    \"E\" -- day of week\n    \"e\" -- weekday number / day of week\n    \"a\" -- day period (AM, PM)\n    \"b\" -- day period (am, pm, noon, midnight)\n    \"h\" -- hour (12-hour clock)\n    \"H\" -- hour (24-hour clock)\n    \"m\" -- minute\n    \"s\" -- second\n    \"S\" -- fractional second\n    \"X\" -- time offset, using \"Z\" when offset is 0\n    \"x\" -- time offset\n\nThe non-standard pattern field \"ddd\" is available to indicate the day of the\nmonth with an ordinal suffix (e.g. \"1st\", \"15th\"), as the current standard does\nnot include such a field.\n\n    Date.toFormattedString\n        \"MMMM ddd, y\"\n        (Date.fromParts 2007 Mar 15 13 45 56 67)\n    -- \"March 15th, 2007\"\n\n",
                "type": "String -> Date -> String"
            },
            {
                "name": "toIsoString",
                "comment": " Convenience function for formatting a date to ISO 8601 (extended\ndate and time format with local time offset).\n\n    Date.toIsoString\n        (Date.fromParts 2007 Mar 15 13 45 56 67)\n    -- \"2007-03-15T13:45:56.067-04:00\"\n    -- (example has a local offset of UTC-04:00)\n\n",
                "type": "Date -> String"
            },
            {
                "name": "toRataDie",
                "comment": " ",
                "type": "Date -> Int"
            },
            {
                "name": "toUtcFormattedString",
                "comment": " Convert a date to a string just like `toFormattedString`, but using the UTC\nrepresentation instead of the local representation of the date.\n",
                "type": "String -> Date -> String"
            },
            {
                "name": "toUtcIsoString",
                "comment": " Convenience function for formatting a date, in UTC representation, to ISO\n8601 (extended date and time format with \"Z\" for time offset).\n\n    Date.toUtcIsoString\n        (Date.fromParts 2007 Mar 15 13 45 56 67)\n    -- \"2007-03-15T17:45:56.067Z\"\n    -- (example has a local offset of UTC-04:00)\n\n",
                "type": "Date -> String"
            },
            {
                "name": "utc",
                "comment": " Use UTC (i.e. no offset).\n",
                "type": "OffsetSpec"
            },
            {
                "name": "weekDate",
                "comment": " Create a `DateSpec` from week-date parts (weekYear, weekNumber, weekday).\n",
                "type": "Int -> Int -> Day -> DateSpec"
            },
            {
                "name": "weekNumber",
                "comment": " Extract the week number of a date. Given the date 23 June 1990 at\n11:45 a.m. this returns the integer 25.\n",
                "type": "Date -> Int"
            },
            {
                "name": "weekYear",
                "comment": " Extract the week-numbering year of a date. Given the date 23 June\n1990 at 11:45 a.m. this returns the integer 1990.\n",
                "type": "Date -> Int"
            },
            {
                "name": "weekdayNumber",
                "comment": " Extract the weekday number (beginning at 1 for Monday) of a date. Given\nthe date 23 June 1990 at 11:45 a.m. this returns the integer 6.\n",
                "type": "Date -> Int"
            },
            {
                "name": "weekdayToNumber",
                "comment": "\n\n    weekdayToNumber Mon -- 1\n\n",
                "type": "Day -> Int"
            }
        ],
        "binops": []
    }
]