mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Timeline: Added ::excluded
This commit is contained in:
parent
5f42516f38
commit
9bc73febf3
2 changed files with 17 additions and 0 deletions
|
@ -102,6 +102,7 @@ std::vector <Interval> Timeline::tracked (Rules& rules) const
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Untracked time is that which is not excluded, and not filled. Gaps.
|
||||
std::vector <Interval> Timeline::untracked (Rules& rules) const
|
||||
{
|
||||
std::vector <Interval> combined;
|
||||
|
@ -112,6 +113,21 @@ std::vector <Interval> Timeline::untracked (Rules& rules) const
|
|||
return combined;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Excluded time is that which is not available for work.
|
||||
std::vector <Range> Timeline::excluded (Rules& rules) const
|
||||
{
|
||||
// Create a range representing the whole timeline.
|
||||
// If no range is defined, then assume the full range of all the inclusions.
|
||||
Range overallRange {range};
|
||||
if (! overallRange.started () &&
|
||||
! overallRange.ended ())
|
||||
overallRange = overallRangeFromIntervals (_inclusions);
|
||||
|
||||
// Cobmine all the non-trackable time.
|
||||
return combineHolidaysAndExclusions (overallRange, rules, _exclusions);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string Timeline::dump () const
|
||||
{
|
||||
|
|
|
@ -41,6 +41,7 @@ public:
|
|||
void exclude (const Exclusion&);
|
||||
std::vector <Interval> tracked (Rules&) const;
|
||||
std::vector <Interval> untracked (Rules&) const;
|
||||
std::vector <Range> excluded (Rules&) const;
|
||||
std::string dump () const;
|
||||
|
||||
public:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue