Add configurable default range for reports

Query rule 'reports.<name>.range' for the specific default range of the report.
Use rule 'reports.range' to configure an overall default range for all reports.
Make internal reports 'summary', 'month', 'week', 'day', and 'gaps' use this feature.

Closes #477

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
Thomas Lauf 2022-09-23 14:04:01 +02:00
parent d056719a36
commit 5265b26e86
8 changed files with 84 additions and 11 deletions

View file

@ -14,6 +14,7 @@ A chart summarizes the tracked and untracked time with colored blocks drawn on a
It accepts date ranges and tags for filtering.
There are three types: *day*, *week*, and *month* with their respective commands.
The **reports.**__<type>__**.range** configuration setting overrides the default date range.
One can override the global default date range with the **reports.range** configuration.
For more details, and precise times, use the 'summary' report.
*month*::

View file

@ -18,3 +18,14 @@ This does however assume there is a 'foo' extension installed.
The return code is the return code of the extension.
If the extension produces no output and a non-zero rc, then 255 is returned.
== CONFIGURATION
**reports.range**::
Sets the default date range for all reports.
The value has to be a range hint, see timew-hints(7).
Defaults to `:all`
**reports.**__<name>__**.range**::
Set the date range for report _name_, where _name_ is the name of the report executable without its extension (i.e. a report executable 'foo.py' is referred to by 'foo').
The value has to be a range hint, see timew-hints(7).

View file

@ -37,6 +37,11 @@ Determines whether the id column is shown in the summary.
Can be overridden by the ':ids' and ':no-ids' hint, respectively.
Default value is 'no'
**reports.summary.range**::
Set the date range for the summary report.
The value has to be a range hint, see timew-hints(7).
Default value is ':day'
**tags.**__<tag>__**.color**::
Assigns a specific foreground and background color to a tag.
Examples of valid colors include 'white', 'gray8', 'black on yellow', and 'rgb345'.