mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CmdSummary: Do not extend end time beyond end of day
When showing a summary, set the end time to the current time on the last day only. This prevents over-counting of time when a tracked interval covers multiple days. Fixes test TestSummary.test_with_open_interval when the system time is between midnight and 01:00 AM.
This commit is contained in:
parent
616ca4b884
commit
d54bc6ba55
1 changed files with 1 additions and 1 deletions
|
@ -126,7 +126,7 @@ int CmdSummary (
|
||||||
|
|
||||||
// Intersect track with day.
|
// Intersect track with day.
|
||||||
auto today = day_range.intersect (track.range);
|
auto today = day_range.intersect (track.range);
|
||||||
if (track.range.is_open () && day <= Datetime ())
|
if (track.range.is_open () && day <= Datetime () && today.end > Datetime ())
|
||||||
today.end = Datetime ();
|
today.end = Datetime ();
|
||||||
|
|
||||||
std::string tags = join(", ", track.tags());
|
std::string tags = join(", ", track.tags());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue