summaryrefslogtreecommitdiff
path: root/Logs/MapLog.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-05-10 14:45:55 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-05-10 15:21:35 -0400
commitea506b28110d0e23210fb788b16ffe3deb92f23b (patch)
treee75cd9cbf7e45375f0619a97d2ffb62af3fe31ef /Logs/MapLog.hs
parent0c7caf1e92eda1dde83b9fa95da5fc304ae2767d (diff)
support time-1.5.0
This no longer uses old-locale's defaultTimeLocale, but provides one of its own. Factored out a Logs.TimeStamp.
Diffstat (limited to 'Logs/MapLog.hs')
-rw-r--r--Logs/MapLog.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Logs/MapLog.hs b/Logs/MapLog.hs
index 3c7eef26b..d5bb67f68 100644
--- a/Logs/MapLog.hs
+++ b/Logs/MapLog.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE CPP #-}
+
{- git-annex Map log
-
- This is used to store a Map, in a way that can be union merged.
@@ -13,10 +15,9 @@ module Logs.MapLog where
import qualified Data.Map as M
import Data.Time.Clock.POSIX
-import Data.Time
-import System.Locale
import Common
+import Logs.TimeStamp
data TimeStamp = Unknown | Date POSIXTime
deriving (Eq, Ord, Show)
@@ -42,7 +43,7 @@ parseMapLog fieldparser valueparser = M.fromListWith best . mapMaybe parse . lin
parse line = do
let (ts, rest) = splitword line
(sf, sv) = splitword rest
- date <- Date . utcTimeToPOSIXSeconds <$> parseTime defaultTimeLocale "%s%Qs" ts
+ date <- Date <$> parsePOSIXTime ts
f <- fieldparser sf
v <- valueparser sv
Just (f, LogEntry date v)