mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
data: No longer closes all intervals after subtracting ranges
This commit is contained in:
parent
d995ff57b7
commit
2c5dd1dec0
1 changed files with 12 additions and 4 deletions
12
src/data.cpp
12
src/data.cpp
|
@ -401,10 +401,18 @@ std::vector <Interval> flatten (
|
||||||
// Only historical data is included.
|
// Only historical data is included.
|
||||||
if (chunk.range.start <= now)
|
if (chunk.range.start <= now)
|
||||||
{
|
{
|
||||||
// A future range.end should be truncated.
|
// Closed chunk ranges in the future need to be adjusted.
|
||||||
if (! chunk.range.is_open () &&
|
if (! chunk.range.is_open () &&
|
||||||
chunk.range.end >= now)
|
chunk.range.end > now)
|
||||||
|
{
|
||||||
|
// If the interval is open, so must be chunk.
|
||||||
|
if (interval.range.is_open ())
|
||||||
|
chunk.range.end = {0};
|
||||||
|
|
||||||
|
// Otherwise truncate to now.
|
||||||
|
else
|
||||||
chunk.range.end = now;
|
chunk.range.end = now;
|
||||||
|
}
|
||||||
|
|
||||||
all.push_back (chunk);
|
all.push_back (chunk);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue