X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Rakka%2FW3CDateTime.hs;h=488cd2e08eabe75c3cd76750f10b3acaaa0c7166;hb=e3e30c2bfa341cef11754e3f4d90b03844ef74d1;hp=595d228aee22db29c63951c95af21bf91113145e;hpb=43113f26d3e61c96d896724c5509abe67b6a99e7;p=Rakka.git diff --git a/Rakka/W3CDateTime.hs b/Rakka/W3CDateTime.hs index 595d228..488cd2e 100644 --- a/Rakka/W3CDateTime.hs +++ b/Rakka/W3CDateTime.hs @@ -29,7 +29,7 @@ formatW3CDateTime zonedTime day (todHour timeOfDay) (todMin timeOfDay) - (secInt :: Int)) + (secInt :: Int) ++ (if secFrac == 0 then "" @@ -77,11 +77,11 @@ w3cDateTime = do year <- liftM read (count 4 digit) return zonedTime where time :: Parser (Int, Int, Double, Int) - time = do char 'T' + time = do _ <- char 'T' hour <- liftM read (count 2 digit) - char ':' + _ <- char ':' min <- liftM read (count 2 digit) - sec <- option 0 $ do char ':' + sec <- option 0 $ do _ <- char ':' secInt <- count 2 digit secFrac <- option "" $ do c <- char '.' cs <- many1 digit @@ -93,7 +93,7 @@ w3cDateTime = do year <- liftM read (count 4 digit) <|> (char '-' >> return (-1)) h <- liftM read (count 2 digit) - char ':' + _ <- char ':' m <- liftM read (count 2 digit) return $ sign * h * 60 + m) return (hour, min, sec, offMin) \ No newline at end of file