From 016d6ddd20c5c67b07f2891e5049e682683f11c0 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Tue, 19 May 2020 19:10:56 +0200 Subject: [PATCH] History: correct event time of cancelled downtimes refs #183 --- configobject/history/history.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configobject/history/history.go b/configobject/history/history.go index 9a3a712e..55a08fc8 100644 --- a/configobject/history/history.go +++ b/configobject/history/history.go @@ -291,7 +291,11 @@ func downtimeHistoryWorker(super *supervisor.Supervisor) { case "downtime_start": eventTime = values["start_time"].(string) case "downtime_end": - eventTime = values["end_time"].(string) + if values["has_been_cancelled"].(string) == "1" { + eventTime = values["cancel_time"].(string) + } else { + eventTime = values["end_time"].(string) + } } data := []interface{}{