From 4a558948bbb4cb73587c52d23201b3e1da2ff0ca Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 16 Feb 2017 19:15:57 +0100 Subject: Have numeric timezones use new parsers --- lib/Postdelay/TimeSpec.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/Postdelay') 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 numericTimezone :: StringParser s m => m TimeZone numericTimezone = review utcOffset <$> (sign <*> ((^+^) <$> hour <*> minute)) "Numeric timezone" where - hour = (% Hour) <$> twoDigit - minute = (% Minute) <$> twoDigit - twoDigit = (\n1 n2 -> fromDigit n1 * 10 + fromDigit n2) <$> digitChar <*> digitChar + hour = (% Hour) <$> boundedNatural True (0 <=..<= 24) + minute = (% Minute) <$> boundedNatural True (0 <=..< 60) namedTimezone :: (StringParser s m, MonadIO m) => m TZ namedTimezone = do -- cgit v1.2.3