@@ -456,24 +456,31 @@ timeToUrlPiece :: FormatTime t => String -> t -> Text
456456timeToUrlPiece fmt = T.pack . formatTime defaultTimeLocale (iso8601DateFormat (Just fmt))
457457
458458-- |
459−-- >>> toUrlPiece $ LocalTime (fromGregorian 2015 10 03) (TimeOfDay 14 55 01)
460−-- "2015-10-03T14:55:01"
459+-- >>> toUrlPiece $ TimeOfDay 14 55 23.1
460+-- "14:55:23.1"
461+instance ToHttpApiData TimeOfDay where
462+ toUrlPiece = T.pack . formatTime defaultTimeLocale "%H:%M:%S%Q"
463+ toEncodedUrlPiece = unsafeToEncodedUrlPiece
464+
465+-- |
466+-- >>> toUrlPiece $ LocalTime (fromGregorian 2015 10 03) (TimeOfDay 14 55 21.687)
467+-- "2015-10-03T14:55:21.687"
461468instance ToHttpApiData LocalTime where
462− toUrlPiece = timeToUrlPiece "%H:%M:%S"
469+ toUrlPiece = timeToUrlPiece "%H:%M:%S%Q"
463470 toEncodedUrlPiece = unsafeToEncodedUrlPiece
464471
465472-- |
466−-- >>> toUrlPiece $ ZonedTime (LocalTime (fromGregorian 2015 10 03) (TimeOfDay 14 55 01)) utc
467−-- "2015-10-03T14:55:01+0000"
473+-- >>> toUrlPiece $ ZonedTime (LocalTime (fromGregorian 2015 10 03) (TimeOfDay 14 55 51.001)) utc
474+-- "2015-10-03T14:55:51.001+0000"
468475instance ToHttpApiData ZonedTime where
469− toUrlPiece = timeToUrlPiece "%H:%M:%S%z"
476+ toUrlPiece = timeToUrlPiece "%H:%M:%S%Q%z"
470477 toEncodedUrlPiece = unsafeToEncodedUrlPiece
471478
472479-- |
473−-- >>> toUrlPiece $ UTCTime (fromGregorian 2015 10 03) 864
474−-- "2015-10-03T00:14:24Z"
480+-- >>> toUrlPiece $ UTCTime (fromGregorian 2015 10 03) 864.5
481+-- "2015-10-03T00:14:24.5Z"
475482instance ToHttpApiData UTCTime where
476− toUrlPiece = timeToUrlPiece "%H:%M:%SZ"
483+ toUrlPiece = timeToUrlPiece "%H:%M:%S%QZ"
477484 toEncodedUrlPiece = unsafeToEncodedUrlPiece
478485
479486instance ToHttpApiData NominalDiffTime where
@@ -580,7 +587,12 @@ instance FromHttpApiData L.Text where parseUrlPiece = Right . L.fromStrict
580587-- |
581588-- >>> toGregorian <$> parseUrlPiece "2016-12-01"
582589-- Right (2016,12,1)
583−instance FromHttpApiData Day where parseUrlPiece = runAtto Atto.day
590+instance FromHttpApiData Day where parseUrlPiece = runAtto Atto.day
591+
592+-- |
593+-- >>> parseUrlPiece "14:55:01.333" :: Either Text TimeOfDay
594+-- Right 14:55:01.333
595+instance FromHttpApiData TimeOfDay where parseUrlPiece = runAtto Atto.timeOfDay
584596
585597-- |
586598-- >>> parseUrlPiece "2015-10-03T14:55:01" :: Either Text LocalTime