From 127c1212d7704392363e3614f339627bf514cfcf Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Feb 2017 19:04:57 +0100 Subject: Timezones --- lib/Postdelay/Scan.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/Postdelay/Scan.hs') 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 zoneHeaders = runListT $ do (OptionalField field content) <- ListT $ return headers guard $ CI.mk field == "X-Timezone" - Right r <- runParserT (spaceConsumer *> lexeme pTimeZone <* eof) field content - return r + either throwM return =<< runParserT (spaceConsumer *> lexeme timeZone <* eof) field content parseDelay :: Field -> m (Endo LocalTime) - parseDelay (OptionalField field content) = either throwM return =<< runParserT (spaceConsumer *> lexeme pTimeSpec <* eof) field content + parseDelay (OptionalField field content) = either throwM return =<< runParserT (spaceConsumer *> lexeme timeSpec <* eof) field content localT :: Either TimeZone TZ -> Iso' UTCTime LocalTime localT (Left tz) = iso (utcToLocalTime tz) (localTimeToUTC tz) -- cgit v1.2.3