on master help sign in
Merge pull request #541 from phaazon/master

Document ZonedTime FromJSON instance.

commit1cf3edc3fab98a530042891b63bd363c94cf15de authorAdam Bergmark <adam@bergmark.nl> dateSun 16 Apr 2017, 13:26 (9 years ago) parent0e4341ee227483
1 file changed+11
Data/Aeson/Types/FromJSON.hs+11
Data/Aeson/Types/FromJSON.hs+11
@@ -1671,6 +1671,17 @@ instance FromJSONKey LocalTime where
16711671 fromJSONKey = FromJSONKeyTextParser (Time.run Time.localTime)
16721672
16731673
1674+-- | Supported string formats:
1675+--
1676+-- @YYYY-MM-DD HH:MM Z@
1677+-- @YYYY-MM-DD HH:MM:SS Z@
1678+-- @YYYY-MM-DD HH:MM:SS.SSS Z@
1679+--
1680+-- The first space may instead be a @T@, and the second space is
1681+-- optional. The @Z@ represents UTC. The @Z@ may be replaced with a
1682+-- time zone offset of the form @+0000@ or @-08:00@, where the first
1683+-- two digits are hours, the @:@ is optional and the second two digits
1684+-- (also optional) are minutes.
16741685instance FromJSON ZonedTime where
16751686 parseJSON = withText "ZonedTime" (Time.run Time.zonedTime)
16761687