From e23420a3fa6c5822c1ff46dfa64853924d861963 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Mon, 4 Sep 2023 11:30:11 +0200 Subject: [PATCH] #11968-Fix Histogram graph pdf --- .../include/graphs/flot/pandora.flot.js | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index 37162f5a37..56cd4a71a1 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -943,17 +943,25 @@ function pandoraFlotSlicebar( // Format functions function xFormatter(v) { - // var ct = new Date(); - var ct = new timezoneJS.Date(); - ct.setTimezone(phpTimezone); + var ct; + if (typeof timezoneJS === "undefined") { + ct = new Date(); + } else { + ct = new timezoneJS.Date(); + ct.setTimezone(phpTimezone); + } var currentTime = ct.getTime(); var diffDates = (currentTime - 1000 * datelimit) / 1000; - // var d = new Date(1000 * (v + datelimit)); - var d = new timezoneJS.Date(1000 * (v + datelimit)); - d.setTimezone(phpTimezone); + var d; + if (typeof timezoneJS === "undefined") { + d = new Date(1000 * (v + datelimit)); + } else { + d = new timezoneJS.Date(1000 * (v + datelimit)); + d.setTimezone(phpTimezone); + } var monthNames = [ "Jan",