diff options
author | Gregor Kleen <aethoago@141.li> | 2017-02-15 19:04:57 +0100 |
---|---|---|
committer | Gregor Kleen <aethoago@141.li> | 2017-02-15 19:04:57 +0100 |
commit | 127c1212d7704392363e3614f339627bf514cfcf (patch) | |
tree | 10e9a0a1f48ec8aef518c3c33a6e34a7043d9738 /lib/Postdelay/Scan.hs | |
parent | 5b09b096e38ed231b62df57736e87c989b481b5d (diff) | |
download | postdelay-127c1212d7704392363e3614f339627bf514cfcf.tar postdelay-127c1212d7704392363e3614f339627bf514cfcf.tar.gz postdelay-127c1212d7704392363e3614f339627bf514cfcf.tar.bz2 postdelay-127c1212d7704392363e3614f339627bf514cfcf.tar.xz postdelay-127c1212d7704392363e3614f339627bf514cfcf.zip |
Timezones
Diffstat (limited to 'lib/Postdelay/Scan.hs')
-rw-r--r-- | lib/Postdelay/Scan.hs | 5 |
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 | ||
76 | localT :: Either TimeZone TZ -> Iso' UTCTime LocalTime | 75 | localT :: Either TimeZone TZ -> Iso' UTCTime LocalTime |
77 | localT (Left tz) = iso (utcToLocalTime tz) (localTimeToUTC tz) | 76 | localT (Left tz) = iso (utcToLocalTime tz) (localTimeToUTC tz) |