mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
data: Added ::getAllExclusions debug output
This commit is contained in:
parent
0b12b51309
commit
677e9869cb
1 changed files with 6 additions and 1 deletions
|
@ -256,9 +256,10 @@ std::vector <Range> getAllExclusions (
|
||||||
std::vector <Exclusion> exclusions;
|
std::vector <Exclusion> exclusions;
|
||||||
for (auto& name : rules.all ("exclusions."))
|
for (auto& name : rules.all ("exclusions."))
|
||||||
exclusions.push_back (Exclusion (lowerCase (name), rules.get (name)));
|
exclusions.push_back (Exclusion (lowerCase (name), rules.get (name)));
|
||||||
|
debug (format ("Found {1} exclusions", exclusions.size ()));
|
||||||
|
|
||||||
// Find exclusions 'exc day on <date>' and remove from holidays.
|
// Find exclusions 'exc day on <date>' and remove from holidays.
|
||||||
// Find exlcusions 'exc day off <date>' and add to holidays.
|
// Find exclusions 'exc day off <date>' and add to holidays.
|
||||||
std::vector <Range> daysOn;
|
std::vector <Range> daysOn;
|
||||||
std::vector <Range> daysOff;
|
std::vector <Range> daysOff;
|
||||||
for (auto& exclusion : exclusions)
|
for (auto& exclusion : exclusions)
|
||||||
|
@ -276,6 +277,10 @@ std::vector <Range> getAllExclusions (
|
||||||
|
|
||||||
// daysOff are combined with existing holidays.
|
// daysOff are combined with existing holidays.
|
||||||
results = addRanges (range, results, daysOff);
|
results = addRanges (range, results, daysOff);
|
||||||
|
if (daysOn.size ())
|
||||||
|
debug (format ("Found {1} additional working days", daysOn.size ()));
|
||||||
|
if (daysOff.size ())
|
||||||
|
debug (format ("Found {1} additional non-working days", daysOff.size ()));
|
||||||
|
|
||||||
// daysOn are subtracted from the existing holidays.
|
// daysOn are subtracted from the existing holidays.
|
||||||
results = subtractRanges (results, daysOn);
|
results = subtractRanges (results, daysOn);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue