]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blobdiff - src/TSN/Picklers.hs
Migrate TSN.XML.Injuries to fixed-vector-hetero.
[dead/htsn-import.git] / src / TSN / Picklers.hs
index 09c3a3b1000ac983251108afb5e570bdb40eb8c5..5e620699bbfdc43e53181511493be47f433349ba 100644 (file)
@@ -270,8 +270,8 @@ xp_datetime =
 --
 --   >>> import Data.Maybe ( fromJust )
 --   >>> :{
---         let parse_date :: String -> Maybe UTCTime;
---         parse_date = parseTime defaultTimeLocale date_format;
+--         let parse_date :: String -> Maybe UTCTime
+--             parse_date = parseTime defaultTimeLocale date_format
 --       :}
 --
 --   >>> let dates = [ "1/" ++ (d : "/1970") | d <- ['1'..'9'] ]
@@ -474,9 +474,12 @@ xp_time_stamp :: PU UTCTime
 xp_time_stamp =
   (parse_time_stamp, from_time_stamp) `xpWrapMaybe` xpText
   where
+    -- | We have to re-pad the time_stamp_format with a leading and
+    --   trailing space; see the documentation of 'time_stamp_format'
+    --   for more information.
     from_time_stamp :: UTCTime -> String
     from_time_stamp =
-      formatTime defaultTimeLocale time_stamp_format
+      formatTime defaultTimeLocale (" " ++ time_stamp_format ++ " ")