summaryrefslogtreecommitdiff
path: root/lib/Postdelay
diff options
context:
space:
mode:
authorGregor Kleen <aethoago@141.li>2017-02-16 19:15:57 +0100
committerGregor Kleen <aethoago@141.li>2017-02-16 19:15:57 +0100
commit4a558948bbb4cb73587c52d23201b3e1da2ff0ca (patch)
treea4a95dcccb826191d404509d1cf7e43a2e7fa5b1 /lib/Postdelay
parent3dc71afee7b4efc214e159176e380182ac5141dd (diff)
downloadpostdelay-4a558948bbb4cb73587c52d23201b3e1da2ff0ca.tar
postdelay-4a558948bbb4cb73587c52d23201b3e1da2ff0ca.tar.gz
postdelay-4a558948bbb4cb73587c52d23201b3e1da2ff0ca.tar.bz2
postdelay-4a558948bbb4cb73587c52d23201b3e1da2ff0ca.tar.xz
postdelay-4a558948bbb4cb73587c52d23201b3e1da2ff0ca.zip
Have numeric timezones use new parsers
Diffstat (limited to 'lib/Postdelay')
-rw-r--r--lib/Postdelay/TimeSpec.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Postdelay/TimeSpec.hs b/lib/Postdelay/TimeSpec.hs
index f84a196..0736e80 100644
--- a/lib/Postdelay/TimeSpec.hs
+++ b/lib/Postdelay/TimeSpec.hs
@@ -104,9 +104,8 @@ timeZone = label "Timezone" $ (Left <$> numericTimezone) <|> (Right <$> namedTim
104numericTimezone :: StringParser s m => m TimeZone 104numericTimezone :: StringParser s m => m TimeZone
105numericTimezone = review utcOffset <$> (sign <*> ((^+^) <$> hour <*> minute)) <?> "Numeric timezone" 105numericTimezone = review utcOffset <$> (sign <*> ((^+^) <$> hour <*> minute)) <?> "Numeric timezone"
106 where 106 where
107 hour = (% Hour) <$> twoDigit 107 hour = (% Hour) <$> boundedNatural True (0 <=..<= 24)
108 minute = (% Minute) <$> twoDigit 108 minute = (% Minute) <$> boundedNatural True (0 <=..< 60)
109 twoDigit = (\n1 n2 -> fromDigit n1 * 10 + fromDigit n2) <$> digitChar <*> digitChar
110 109
111namedTimezone :: (StringParser s m, MonadIO m) => m TZ 110namedTimezone :: (StringParser s m, MonadIO m) => m TZ
112namedTimezone = do 111namedTimezone = do