mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00
Add configurable default range for report 'gaps'
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
parent
c6130157c6
commit
fd1e26eff3
2 changed files with 7 additions and 12 deletions
|
@ -90,9 +90,6 @@ Rules::Rules ()
|
|||
// 'summary' report.
|
||||
{"reports.summary.holidays", "yes"},
|
||||
|
||||
// 'gaps' report.
|
||||
{"reports.gaps.range", ":day"},
|
||||
|
||||
// Enough of a theme to make the charts work.
|
||||
{"theme.description", "Built-in default"},
|
||||
{"theme.colors.exclusion", "gray8 on gray4"},
|
||||
|
|
|
@ -39,15 +39,13 @@ int CmdGaps (
|
|||
{
|
||||
const bool verbose = rules.getBoolean ("verbose");
|
||||
|
||||
// If filter is empty, choose 'today'.
|
||||
auto filter = cli.getFilter ();
|
||||
if (! filter.is_started ())
|
||||
{
|
||||
if (rules.has ("reports.gaps.range"))
|
||||
expandIntervalHint (rules.get ("reports.gaps.range"), filter);
|
||||
else
|
||||
filter.setRange (Datetime ("today"), Datetime ("tomorrow"));
|
||||
}
|
||||
auto default_hint = rules.get ("reports.range", "day");
|
||||
auto report_hint = rules.get ("reports.gaps.range", default_hint);
|
||||
|
||||
Range default_range = {};
|
||||
expandIntervalHint (":" + report_hint, default_range);
|
||||
|
||||
auto filter = cli.getFilter (default_range);
|
||||
|
||||
// Is the :blank hint being used?
|
||||
bool blank = cli.getHint ("blank", false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue