lib: capitalised month names broke some period expressions (fix #852)

This was a regression in hledger 1.10.
mon[th]Index are now case insensitive.
This commit is contained in:
Simon Michael 2018-07-30 11:06:40 +01:00
parent daa37a9993
commit 007b9f8caa

View File

@ -844,8 +844,11 @@ monthabbrevs = ["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","n
weekdays = ["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]
weekdayabbrevs = ["mon","tue","wed","thu","fri","sat","sun"]
monthIndex t = maybe 0 (+1) $ t `elemIndex` months
monIndex t = maybe 0 (+1) $ t `elemIndex` monthabbrevs
-- | Convert a case insensitive english month name to a month number.
monthIndex name = maybe 0 (+1) $ T.toLower name `elemIndex` months
-- | Convert a case insensitive english three-letter month abbreviation to a month number.
monIndex name = maybe 0 (+1) $ T.toLower name `elemIndex` monthabbrevs
month :: TextParser m SmartDate
month = do