data: merge error skips one range

This commit is contained in:
Paul Beckingham 2016-07-04 13:08:52 -04:00
parent 10fcc07aa5
commit 61647e0f26
2 changed files with 3 additions and 2 deletions

View file

@ -120,7 +120,7 @@ std::vector <Range> Exclusion::ranges (const Range& range) const
else if ((dayOfWeek = Datetime::dayOfWeek (_tokens[1])) != -1)
{
Datetime start (range.start.year (), range.start.month (), range.start.day (), 0, 0, 0);
while (start < range.end)
while (start <= range.end)
{
if (start.dayOfWeek () == dayOfWeek)
{

View file

@ -295,7 +295,7 @@ std::vector <Range> getAllExclusions (
results = subtractRanges (results, daysOn);
// Expand all exclusions that are not 'exc day ...' into excluded ranges that
// overlage with range.
// overlap with range.
std::vector <Range> exclusionRanges;
for (auto& exclusion : exclusions)
if (exclusion.tokens ()[1] != "day")
@ -459,6 +459,7 @@ std::vector <Range> merge (
}
else
{
sorted[cursor] = sorted[i];
++cursor;
}
}