mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-12 19:08:34 +03:00
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:
parent
daa37a9993
commit
007b9f8caa
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user