diff --git a/hledger/hledger.m4.md b/hledger/hledger.m4.md index 00d16661c..5114ff3f9 100644 --- a/hledger/hledger.m4.md +++ b/hledger/hledger.m4.md @@ -698,26 +698,6 @@ Examples: | `-p "every 5th November"` | same | | `-p "every Nov 5th"` | same | -Intervals beginning on multiple days of the week can be specified by combining -`WEEKDAYNAME`s with commas. For example, an expression that starts a new period -on every standard weekday would be `mon,tue,wed,thu,fri`. For convenience, the -special period expressions `weekday` and `weekendday` are effectively -`mon|tue|wed|thu|fri` and `sat|sun` respectively. - -Note that this will generate adjacent but uneven periods so the periods may not -be as directly comparable. This is probably most useful as a periodic -transaction (#periodic-transactions). - -Examples: - -| | | -|------------------------------|-------------------------------------------------------------| -| `-p "every mon,fri"` | periods will be `[Mon, Fri), [Fri, Mon)...` | -| `-p "every mon,wed,fri"` | periods will be `[Mon, Wed), [Wed, Fri), [Fri, Mon)...` | -| `-p "every weekday"` | periods will be `[Mon], [Tue], [Wed], [Thu], [Fri, Mon)...` | -| `-p "every weekendday"` | periods will be `[Sat], [Sun, Sat)...` | - - Show historical balances at end of the 15th day of each month (N is an end date, exclusive as always): ```shell @@ -730,6 +710,39 @@ Group postings from the start of wednesday to end of the following tuesday (N is $ hledger register checking -p "every 3rd day of week" ``` +### Periods or dates ? + +Report intervals like the above are most often used with `-p|--period`, +to divide reports into multiple subperiods - +each generated date marks a subperiod boundary. +Here, the periods between the dates are what's important. + +But report intervals can also be used +with `--forecast` to generate future transactions, +or with `balance --budget` to generate budget goal-setting transactions. +For these, the dates themselves are what matters. + +### Events on multiple weekdays + +The `every WEEKDAYNAME` form has a special variant with multiple day names, comma-separated. +Eg: `every mon,thu,sat`. +Also, `weekday` and `weekendday` are shorthand for `mon,tue,wed,thu,fri` and `sat,sun` +respectively. + +This form is mainly intended for use with `--forecast`, to generate +[periodic transactions](#periodic-transactions) on arbitrary days of the week. +It may be less useful with `-p`, since it divides each week into subperiods +of unequal length. (Because gaps between periods are not allowed; +if you'd like to change this, see [#1632](https://github.com/simonmichael/hledger/pull/1632).) + +Examples: + +| | | +|------------------------------|----------------------------------------------------------------------------------------| +| `-p "every mon,wed,fri"` | dates will be Mon, Wed, Fri;
periods will be Mon-Tue, Wed-Thu, Fri-Sun | +| `-p "every weekday"` | dates will be Mon, Tue, Wed, Thu, Fri;
periods will be Mon, Tue, Wed, Thu, Fri-Sun | +| `-p "every weekendday"` | dates will be Sat, Sun;
periods will be Sat, Sun-Fri | + # DEPTH With the `--depth NUM` option (short form: `-NUM`),