Add three ISO8601 compatible formats

This commit is contained in:
Alex Mason 2016-09-02 15:44:16 +10:00
parent 523fe563c9
commit 539b8c93fa

View file

@ -13,6 +13,9 @@ module Servant.API.Times
, getFormat , getFormat
, renderTime , renderTime
, parseTime , parseTime
, ISO8601Date
, ISO8601DateTime
, ISO8601DateTimeZ
) where ) where
import Data.Typeable (Typeable) import Data.Typeable (Typeable)
@ -27,6 +30,11 @@ import Data.Proxy
import Control.Monad ((>=>)) import Control.Monad ((>=>))
import Control.Arrow (first) import Control.Arrow (first)
type ISO8601Date = "%Y-%m-%d"
type ISO8601DateTime = "%Y-%m-%dT%H:%M:%S"
type ISO8601DateTimeZ = "%Y-%m-%dT%H:%M:%S%z"
-- | A wrapper around a time type which can be parsed/rendered to with `format', -- | A wrapper around a time type which can be parsed/rendered to with `format',
-- as specified in 'Data.Time.Format'. -- as specified in 'Data.Time.Format'.
-- --