mirror of https://github.com/Icinga/icinga2.git
commit
5e95dd71be
|
@ -16,8 +16,8 @@ object TimePeriod "24x7" inherits "legacy-timeperiod" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
object TimePeriod "8x5" inherits "legacy-timeperiod" {
|
object TimePeriod "9to5" inherits "legacy-timeperiod" {
|
||||||
display_name = "Icinga 2 8x5 TimePeriod",
|
display_name = "Icinga 2 9to5 TimePeriod",
|
||||||
ranges = {
|
ranges = {
|
||||||
"monday" = "09:00-17:00",
|
"monday" = "09:00-17:00",
|
||||||
"tuesday" = "09:00-17:00",
|
"tuesday" = "09:00-17:00",
|
||||||
|
|
|
@ -70,12 +70,12 @@ void TimePeriod::AddSegment(double begin, double end)
|
||||||
if (segment->Get("begin") <= begin && segment->Get("end") >= end)
|
if (segment->Get("begin") <= begin && segment->Get("end") >= end)
|
||||||
return; /* New segment is fully contained in this segment. */
|
return; /* New segment is fully contained in this segment. */
|
||||||
|
|
||||||
if (segment->Get("begin") < begin && segment->Get("end") > begin) {
|
if (segment->Get("begin") <= begin && segment->Get("end") >= begin) {
|
||||||
segment->Set("end", end); /* Extend an existing segment. */
|
segment->Set("end", end); /* Extend an existing segment. */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (segment->Get("begin") > begin && segment->Get("begin") < end) {
|
if (segment->Get("begin") >= begin && segment->Get("begin") <= end) {
|
||||||
segment->Set("begin", begin); /* Extend an existing segment. */
|
segment->Set("begin", begin); /* Extend an existing segment. */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue