Skip to content

Commit

Permalink
;doc:csv: clarify intra-day-reversed
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichael committed Aug 14, 2023
1 parent 588d0df commit 6a12ff1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions hledger/hledger.m4.md
Original file line number Diff line number Diff line change
Expand Up @@ -2925,7 +2925,7 @@ For others, use numeric format: +HHMM or -HHMM.
## `newest-first`

hledger tries to ensure that the generated transactions will be ordered chronologically,
including intra-day transactions.
including same-day transactions.
Usually it can auto-detect how the CSV records are ordered.
But if it encounters CSV where all records are on the same date,
it assumes that the records are oldest first.
Expand All @@ -2945,16 +2945,15 @@ newest-first

## `intra-day-reversed`

CSV records for each day are sometimes ordered in reverse compared to the overall date order.
Eg, here dates are newest first, but the transactions on each date are oldest first:
If CSV records within a single day are ordered opposite to the overall record order,
you can add the `intra-day-reversed` rule to improve the order of journal entries.
Eg, here the overall record order is newest first, but same-day records are oldest first:
```csv
2022-10-02, txn 3...
2022-10-02, txn 4...
2022-10-01, txn 1...
2022-10-01, txn 2...
```
In this situation, add the `intra-day-reversed` rule, and hledger will compensate,
improving the order of transactions.
```rules
# transactions within each day are reversed with respect to the overall date order
intra-day-reversed
Expand Down

0 comments on commit 6a12ff1

Please sign in to comment.