allow year parser to handle arbitrarily large years

This commit is contained in:
Simon Michael 2015-07-11 18:44:32 -07:00
parent 7a050d65c8
commit 73e4ccee80

View File

@ -493,7 +493,7 @@ datesepchar :: Stream [Char] m Char => ParsecT [Char] st m Char
datesepchar = oneOf datesepchars
validYear, validMonth, validDay :: String -> Bool
validYear s = length s >= 4 && isJust (readMay s :: Maybe Int)
validYear s = length s >= 4 && isJust (readMay s :: Maybe Year)
validMonth s = maybe False (\n -> n>=1 && n<=12) $ readMay s
validDay s = maybe False (\n -> n>=1 && n<=31) $ readMay s