summaryrefslogtreecommitdiff
path: root/lib/Postdelay/TimeSpec.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Postdelay/TimeSpec.hs')
-rw-r--r--lib/Postdelay/TimeSpec.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Postdelay/TimeSpec.hs b/lib/Postdelay/TimeSpec.hs
index af8d801..676dabf 100644
--- a/lib/Postdelay/TimeSpec.hs
+++ b/lib/Postdelay/TimeSpec.hs
@@ -2,6 +2,7 @@
2 2
3module Postdelay.TimeSpec 3module Postdelay.TimeSpec
4 ( pTimeSpec 4 ( pTimeSpec
5 , pTimeZone
5 , TimeCtx(..) 6 , TimeCtx(..)
6 ) where 7 ) where
7 8
@@ -308,7 +309,7 @@ pTimeBase = choice' [ do
308 pMinute = ensure (< 60) =<< natural 309 pMinute = ensure (< 60) =<< natural
309 pSecond = decimal 310 pSecond = decimal
310 311
311pTimeZone :: MonadTP m => ParsecT String () m (Either TimeZone TZ) 312pTimeZone :: MonadIO m => ParsecT String () m (Either TimeZone TZ)
312pTimeZone = choice' [ do 313pTimeZone = choice' [ do
313 sgn <- choice [ id <$ char '+' 314 sgn <- choice [ id <$ char '+'
314 , negate <$ char '-' 315 , negate <$ char '-'
@@ -317,7 +318,9 @@ pTimeZone = choice' [ do
317 ms <- option 0 $ (\d u -> 10 * d + u) <$> digit <*> digit 318 ms <- option 0 $ (\d u -> 10 * d + u) <$> digit <*> digit
318 return . Left . minutesToTimeZone $ hs * 60 + ms 319 return . Left . minutesToTimeZone $ hs * 60 + ms
319 , do 320 , do
320 n <- many1 $ letter <|> char '/' 321 let
322 ident = (++) <$> many1 alphaNum <*> option "" ((:) <$> oneOf "_-/.+" <*> ident)
323 n <- ident
321 tz <- liftIO $ do 324 tz <- liftIO $ do
322 let 325 let
323 fbHandler :: IO a -> (IOException -> IO a) 326 fbHandler :: IO a -> (IOException -> IO a)