| Copyright | (C) 2016-2025 David M. Johnson (@dmjio) |
|---|---|
| License | BSD3-style (see the file LICENSE) |
| Maintainer | David M. Johnson <code@dmj.io> |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Miso.Date
Description
Synopsis
- data Date
- new :: IO Date
- toDateString :: Date -> IO MisoString
- toISOString :: Date -> IO MisoString
- toJSON :: Date -> IO MisoString
- toLocaleDateString :: Date -> IO MisoString
- toLocaleString :: Date -> IO MisoString
- toLocaleTimeString :: Date -> IO MisoString
- toString :: Date -> IO MisoString
- toTimeString :: Date -> IO MisoString
- toUTCString :: Date -> IO MisoString
- valueOf :: Date -> IO Double
- getDate :: Date -> IO Int
- getDay :: Date -> IO Int
- getFullYear :: Date -> IO Int
- getHours :: Date -> IO Int
- getMilliseconds :: Date -> IO Int
- getMinutes :: Date -> IO Int
- getMonth :: Date -> IO Int
- getSeconds :: Date -> IO Int
- getTime :: Date -> IO Double
- getTimezoneOffset :: Date -> IO Int
- getUTCDate :: Date -> IO Int
- getUTCDay :: Date -> IO Int
- getUTCFullYear :: Date -> IO Int
- getUTCHours :: Date -> IO Int
- getUTCMilliseconds :: Date -> IO Int
- getUTCMinutes :: Date -> IO Int
- getUTCMonth :: Date -> IO Int
- getUTCSeconds :: Date -> IO Int
- setDate :: Int -> Date -> IO Double
- setFullYear :: Int -> Maybe Int -> Maybe Int -> Date -> IO Double
- setHours :: Int -> Maybe Int -> Maybe Int -> Maybe Int -> Date -> IO Double
- setMilliseconds :: Int -> Date -> IO Double
- setMinutes :: Int -> Maybe Int -> Maybe Int -> Date -> IO Double
- setMonth :: Int -> Maybe Int -> Date -> IO Double
- setSeconds :: Int -> Maybe Int -> Date -> IO Double
- setTime :: Double -> Date -> IO Double
- setUTCDate :: Int -> Date -> IO Double
- setUTCFullYear :: Int -> Maybe Int -> Maybe Int -> Date -> IO Double
- setUTCHours :: Int -> Maybe Int -> Maybe Int -> Maybe Int -> Date -> IO Double
- setUTCMilliseconds :: Int -> Date -> IO Double
- setUTCMinutes :: Int -> Maybe Int -> Maybe Int -> Date -> IO Double
- setUTCMonth :: Int -> Maybe Int -> Date -> IO Double
- setUTCSeconds :: Int -> Maybe Int -> Date -> IO Double
Type
Construction
Conversion
toDateString :: Date -> IO MisoString Source #
Returns a human-readable date string.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString
toISOString :: Date -> IO MisoString Source #
Returns an ISO 8601 string.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
toJSON :: Date -> IO MisoString Source #
Returns the JSON representation of the date.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON
toLocaleDateString :: Date -> IO MisoString Source #
Returns a locale-sensitive date string.
toLocaleString :: Date -> IO MisoString Source #
Returns a locale-sensitive date and time string.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString
toLocaleTimeString :: Date -> IO MisoString Source #
Returns a locale-sensitive time string.
toString :: Date -> IO MisoString Source #
Returns the full date string.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toString
toTimeString :: Date -> IO MisoString Source #
toUTCString :: Date -> IO MisoString Source #
valueOf :: Date -> IO Double Source #
Returns the primitive value (milliseconds since epoch).
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/valueOf
Getters
Setters
setFullYear :: Int -> Maybe Int -> Maybe Int -> Date -> IO Double Source #
Sets the full year, with optional month and day.
setHours :: Int -> Maybe Int -> Maybe Int -> Maybe Int -> Date -> IO Double Source #
Sets the hour, with optional minutes, seconds, and milliseconds.
setMinutes :: Int -> Maybe Int -> Maybe Int -> Date -> IO Double Source #
Sets the minutes, with optional seconds and milliseconds.
setMonth :: Int -> Maybe Int -> Date -> IO Double Source #
Sets the month, with optional day of the month.
setSeconds :: Int -> Maybe Int -> Date -> IO Double Source #
Sets the seconds, with optional milliseconds.
setUTCFullYear :: Int -> Maybe Int -> Maybe Int -> Date -> IO Double Source #
Sets the UTC full year, with optional month and day.
setUTCHours :: Int -> Maybe Int -> Maybe Int -> Maybe Int -> Date -> IO Double Source #
Sets the UTC hour, with optional minutes, seconds, and milliseconds.
setUTCMinutes :: Int -> Maybe Int -> Maybe Int -> Date -> IO Double Source #
Sets the UTC minutes, with optional seconds and milliseconds.