Open simonmichael opened 6 years ago
When using tag syntax, the rules are almost the same, but not quite! date2: prefers to acquire from txndate2, eg: ...
This distinction surprised me! I had assumed that date tags and bracketed dates were just two syntaxes for the same underlying concept, and that they would be indistinguishable after the parsing phase.
Me too. I think we should make date2: acquire from postingdate1 for consistency.
http://hledger.org/journal.html#posting-dates Cc'ing from mail list:
On May 18, 2018, at 2:12 AM, Francesco Ariis wrote:
That's interesting about convoluted rules, I didn't think they were. Here's my understanding of year inference in posting dates.
I always think "acquire date information from the nearest appropriate source".
A transaction can have 1-2 dates specified, which I'll call txndate1 and txndate2, and a posting can have 0-2, which I'll call postingdate1 and postingdate2. Here's a sample transaction you could test along with:
Then:
When using tag syntax, the rules are almost the same, but not quite! date2: prefers to acquire from txndate2, eg:
Perhaps this inconsistency should be fixed ?
And yes, I can see there is room for confusion.
But of course,
if you always write the year there are no rules involved.