mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-07 21:15:19 +03:00
allow year parser to handle arbitrarily large years
This commit is contained in:
parent
7a050d65c8
commit
73e4ccee80
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user