Skip to content
Permalink
Browse files

Fix and update documentation on date options

  • Loading branch information...
schoettl committed Jun 29, 2019
1 parent e483faf commit 2b01312004ed006c4860cdee33353b4f7e3b7c12
Showing with 15 additions and 5 deletions.
  1. +1 −1 doc/common.m4
  2. +1 −1 hledger/Hledger/Cli/CliOptions.hs
  3. +13 −3 hledger/hledger_options.m4.md
@@ -138,7 +138,7 @@ m4_define({{_reportingoptions_}}, {{
: multiperiod/multicolumn report by year

`-p --period=PERIODEXP`
: set start date, end date, and/or reporting interval all at once using [period expressions](manual.html#period-expressions) syntax (overrides the flags above)
: set start date, end date, and/or reporting interval all at once using [period expressions](manual.html#period-expressions) syntax

`--date2`
: match the secondary date instead (see command help for other effects)
@@ -141,7 +141,7 @@ reportflags = [
,flagNone ["monthly","M"] (setboolopt "monthly") "multiperiod/multicolumn report by month"
,flagNone ["quarterly","Q"] (setboolopt "quarterly") "multiperiod/multicolumn report by quarter"
,flagNone ["yearly","Y"] (setboolopt "yearly") "multiperiod/multicolumn report by year"
,flagReq ["period","p"] (\s opts -> Right $ setopt "period" s opts) "PERIODEXP" "set start date, end date, and/or report interval all at once (overrides the flags above)"
,flagReq ["period","p"] (\s opts -> Right $ setopt "period" s opts) "PERIODEXP" "set start date, end date, and/or report interval all at once"
,flagNone ["date2"] (setboolopt "date2") "match the secondary date instead. See command help for other effects. (--effective, --aux-date also accepted)" -- see also hiddenflags

-- status/realness/depth/zero filters
@@ -234,8 +234,18 @@ You can specify a start and/or end date using
[`-p/--period`](#period-expressions)
or a [`date:` query](#queries) (described below).
All of these accept the [smart date](#smart-dates) syntax.
One important thing to be aware of when specifying end dates: as in Ledger, end dates are exclusive,
so you need to write the date *after* the last day you want to include.

Some notes:

- As in Ledger, end dates are exclusive, so you need to write the date *after*
the last day you want to include.
- As noted in [reporting options](#general-options):
among start/end dates specified with *options*, the last (i.e. right-most)
option takes precedence.
- The effective report start and end dates are the intersection of the
start/end dates from options and that from `date:` queries.
That is, `date:2019-01 date:2019 -p'2000 to 2030'` yields January 2019, the
smallest common time span.

Examples:

@@ -258,7 +268,7 @@ reports into multiple subperiods. The basic intervals can be
selected with one of `-D/--daily`, `-W/--weekly`, `-M/--monthly`,
`-Q/--quarterly`, or `-Y/--yearly`. More complex intervals may be
specified with a [period expression](#period-expressions).
Report intervals can not be specified with a [query](#queries), currently.
Report intervals can not be specified with a [query](#queries).

## Period expressions

0 comments on commit 2b01312

Please sign in to comment.
You can’t perform that action at this time.