summaryrefslogtreecommitdiff
path: root/lib/Postdelay/Scan.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Postdelay/Scan.hs')
-rw-r--r--lib/Postdelay/Scan.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Postdelay/Scan.hs b/lib/Postdelay/Scan.hs
index 888a237..0a265b4 100644
--- a/lib/Postdelay/Scan.hs
+++ b/lib/Postdelay/Scan.hs
@@ -68,10 +68,9 @@ extractDelay (Message headers _) = do
68 zoneHeaders = runListT $ do 68 zoneHeaders = runListT $ do
69 (OptionalField field content) <- ListT $ return headers 69 (OptionalField field content) <- ListT $ return headers
70 guard $ CI.mk field == "X-Timezone" 70 guard $ CI.mk field == "X-Timezone"
71 Right r <- runParserT (spaceConsumer *> lexeme pTimeZone <* eof) field content 71 either throwM return =<< runParserT (spaceConsumer *> lexeme timeZone <* eof) field content
72 return r
73 parseDelay :: Field -> m (Endo LocalTime) 72 parseDelay :: Field -> m (Endo LocalTime)
74 parseDelay (OptionalField field content) = either throwM return =<< runParserT (spaceConsumer *> lexeme pTimeSpec <* eof) field content 73 parseDelay (OptionalField field content) = either throwM return =<< runParserT (spaceConsumer *> lexeme timeSpec <* eof) field content
75 74
76localT :: Either TimeZone TZ -> Iso' UTCTime LocalTime 75localT :: Either TimeZone TZ -> Iso' UTCTime LocalTime
77localT (Left tz) = iso (utcToLocalTime tz) (localTimeToUTC tz) 76localT (Left tz) = iso (utcToLocalTime tz) (localTimeToUTC tz)