From: PHO Date: Fri, 12 Mar 2010 07:05:29 +0000 (+0900) Subject: 'parse' should assume EOF after w3cDateTime. X-Git-Tag: RELEASE-0.1.0.1~5 X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=9b1ea615a387d121a581dc35d0e5bb91d8162811;p=time-w3c.git 'parse' should assume EOF after w3cDateTime. --- diff --git a/Data/Time/W3C/Parser.hs b/Data/Time/W3C/Parser.hs index 64f96b2..8104ce8 100644 --- a/Data/Time/W3C/Parser.hs +++ b/Data/Time/W3C/Parser.hs @@ -10,7 +10,10 @@ import Data.Time.W3C.Parser.Parsec import Data.Time.W3C.Types parse :: Convertible W3CDateTime t => String -> Maybe t -parse src - = case P.parse w3cDateTime "" src of - Right w3c -> Just (convert w3c) - Left _ -> Nothing +parse src = case P.parse p "" src of + Right w3c -> Just (convert w3c) + Left _ -> Nothing + where + p = do w3c <- w3cDateTime + _ <- P.eof + return w3c \ No newline at end of file diff --git a/time-w3c.cabal b/time-w3c.cabal index 57124b3..dabe6dd 100644 --- a/time-w3c.cabal +++ b/time-w3c.cabal @@ -4,8 +4,8 @@ Synopsis: Parse, format and convert W3C Date and Time Description: This module provides functionalities to parse and format W3C Date and Time. The module can also be used to convert it - from/to "Data.Time.Calendar.Day" and - "Data.Time.LocalTime.ZonedTime". + from/to 'Data.Time.Calendar.Day' and + 'Data.Time.LocalTime.ZonedTime'. License: PublicDomain License-file: COPYING