From 539b8c93fa9401adc85084f6f8d39efc872f894c Mon Sep 17 00:00:00 2001 From: Alex Mason Date: Fri, 2 Sep 2016 15:44:16 +1000 Subject: [PATCH] Add three ISO8601 compatible formats --- servant/src/Servant/API/Times.hs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/servant/src/Servant/API/Times.hs b/servant/src/Servant/API/Times.hs index 96523bfc..2f8e508d 100644 --- a/servant/src/Servant/API/Times.hs +++ b/servant/src/Servant/API/Times.hs @@ -13,6 +13,9 @@ module Servant.API.Times , getFormat , renderTime , parseTime + , ISO8601Date + , ISO8601DateTime + , ISO8601DateTimeZ ) where import Data.Typeable (Typeable) @@ -27,6 +30,11 @@ import Data.Proxy import Control.Monad ((>=>)) 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', -- as specified in 'Data.Time.Format'. --