]> granicus.if.org Git - icinga2/commitdiff
LegacyTimePeriod::ProcessTimeRangeRaw(): support ranges across midnight
authorAlexander A. Klimov <alexander.klimov@icinga.com>
Tue, 12 Mar 2019 14:26:08 +0000 (15:26 +0100)
committerMichael Friedrich <michael.friedrich@icinga.com>
Thu, 6 Jun 2019 11:11:34 +0000 (13:11 +0200)
refs #5261

lib/icinga/legacytimeperiod.cpp

index 5874088ac565aaaec021d01508d84d8f36014ef4..2ae72e6519ac9984de282c367f95fbc53433b6e4 100644 (file)
@@ -342,7 +342,7 @@ void LegacyTimePeriod::ProcessTimeRangeRaw(const String& timerange, tm *referenc
 
        if (begin->tm_hour * 3600 + begin->tm_min * 60 + begin->tm_sec >=
                end->tm_hour * 3600 + end->tm_min * 60 + end->tm_sec)
-               BOOST_THROW_EXCEPTION(std::invalid_argument("Time period segment ends before it begins"));
+               end->tm_hour += 24;
 }
 
 Dictionary::Ptr LegacyTimePeriod::ProcessTimeRange(const String& timestamp, tm *reference)