Module

Data.Moment.Simple

Package
purescript-simple-moment
Repository
passy/purescript-simple-moment

A simple PureScript wrapper around moment.js

#fromDate Source

fromDate :: Date -> Moment

Lift a valid date into a Moment object.

#fromEpoch Source

fromEpoch :: Milliseconds -> Maybe Moment

Construct a Moment object from the milliseconds since 1970-01-01 00:00:00.000. If the timestamp is invalid, Nothing is returned.

#calendar Source

calendar :: Moment -> Effect String

Turn a Moment date into a human-readable string, e.g. "Today, 9:30pm"

#format Source

format :: String -> Moment -> Effect String

Format with the given string, respecting the user's locale.

#formatUTC Source

formatUTC :: String -> Moment -> String

Format with the given string, ignoring the locale timezone.

#formatISO8601 Source

formatISO8601 :: Moment -> Effect String

Format according to ISO-8601, respecting the user's locale.

#formatUTCISO8601 Source

formatUTCISO8601 :: Moment -> String

Format according to ISO-8601, ignoring the locale timezone.

Re-exports from Data.Moment.Simple.Types

#Moment Source

data Moment :: Type