diff options
author | Gregor Kleen <aethoago@141.li> | 2017-02-16 19:15:57 +0100 |
---|---|---|
committer | Gregor Kleen <aethoago@141.li> | 2017-02-16 19:15:57 +0100 |
commit | 4a558948bbb4cb73587c52d23201b3e1da2ff0ca (patch) | |
tree | a4a95dcccb826191d404509d1cf7e43a2e7fa5b1 /lib/Postdelay/TimeSpec.hs | |
parent | 3dc71afee7b4efc214e159176e380182ac5141dd (diff) | |
download | postdelay-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/TimeSpec.hs')
-rw-r--r-- | lib/Postdelay/TimeSpec.hs | 5 |
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 | |||
104 | numericTimezone :: StringParser s m => m TimeZone | 104 | numericTimezone :: StringParser s m => m TimeZone |
105 | numericTimezone = review utcOffset <$> (sign <*> ((^+^) <$> hour <*> minute)) <?> "Numeric timezone" | 105 | numericTimezone = 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 | ||
111 | namedTimezone :: (StringParser s m, MonadIO m) => m TZ | 110 | namedTimezone :: (StringParser s m, MonadIO m) => m TZ |
112 | namedTimezone = do | 111 | namedTimezone = do |