if (tokens.size() > 1)
FindNthWeekday(wday, n, begin);
else
- begin->tm_mday += - begin->tm_wday + wday;
+ begin->tm_mday += (7 - begin->tm_wday + wday) % 7;
begin->tm_hour = 0;
begin->tm_min = 0;
if (tokens.size() > 1)
FindNthWeekday(wday, n, end);
else
- end->tm_mday += - end->tm_wday + wday;
+ end->tm_mday += (7 - end->tm_wday + wday) % 7;
end->tm_hour = 0;
end->tm_min = 0;
ObjectLock olock(ranges);
BOOST_FOREACH(const Dictionary::Pair& kv, ranges) {
+ Log(LogDebug, "ScheduledDowntime")
+ << "Evaluating segment: " << kv.first << ": " << kv.second << " at ";
+
Dictionary::Ptr segment = LegacyTimePeriod::FindNextSegment(kv.first, kv.second, &reference);
if (!segment)
continue;
+ Log(LogDebug, "ScheduledDowntime")
+ << "Considering segment: " << Utility::FormatDateTime("%c", segment->Get("begin")) << " -> " << Utility::FormatDateTime("%c", segment->Get("end"));
+
double begin = segment->Get("begin");
if (begin < now)