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"]
|
weekdays = ["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]
|
||||||
weekdayabbrevs = ["mon","tue","wed","thu","fri","sat","sun"]
|
weekdayabbrevs = ["mon","tue","wed","thu","fri","sat","sun"]
|
||||||
|
|
||||||
monthIndex t = maybe 0 (+1) $ t `elemIndex` months
|
-- | Convert a case insensitive english month name to a month number.
|
||||||
monIndex t = maybe 0 (+1) $ t `elemIndex` monthabbrevs
|
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 :: TextParser m SmartDate
|
||||||
month = do
|
month = do
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user