hledger
hledger copied to clipboard
relative dates in periodic rules use first of year rather than today as reference date
Noticed in #1845 (and previously reported by @wgslr as #1843):
~ quarterly from next quarter
(a) 1
$ hledger -f a.j reg --today=2021-06-01 --forecast=2021
2021-04-01 (a) 1 1
2021-07-01 (a) 1 2
2021-10-01 (a) 1 3
The transactions should start on 7/1, the first quarter after "today". Instead they start on the first quarter after the first day of "today"'s year. This might be related to https://github.com/simonmichael/hledger/commit/0f205295e806fccbfce0adbbff0e0ea6dd9f51d8#diff-fcee3c006b1d2e35b8c279c9daa9963ecdb5910bdc90099f7b3a37b8b529a65dR320. (getYear used to be Nothing unless a Y directive was used, now it is always set to the today's year at the start).
Also recently reported as #1843; continuing here.