From 179d58baf458bb99cb3c1ec1c820ebfb3dbe1e67 Mon Sep 17 00:00:00 2001 From: 1998-felix Date: Wed, 20 Mar 2024 10:10:03 +0300 Subject: [PATCH] feat: Remove conversion to unix Nano Signed-off-by: 1998-felix --- ui/web/static/js/charts.js | 4 +- .../charts/horizontalbarchartmodal.html | 70 +++++++++++++++---- 2 files changed, 57 insertions(+), 17 deletions(-) diff --git a/ui/web/static/js/charts.js b/ui/web/static/js/charts.js index 294b9242..a2169fc7 100644 --- a/ui/web/static/js/charts.js +++ b/ui/web/static/js/charts.js @@ -798,14 +798,14 @@ class HorizontalBarChart extends Echart { function getInterval(chartData) { const interval = chartData.to - chartData.from; - const nanosecondsPerSecond = 1e3; + const millisecondsPerSecond = 1e3; const secondsPerMinute = 60; const minutesPerHour = 60; let minutes = 0; let hours = 0; let intervalString = ""; - let seconds = parseInt(interval) / nanosecondsPerSecond; + let seconds = parseInt(interval) / millisecondsPerSecond; intervalString = Math.ceil(seconds).toString() +'s'; if (seconds >= secondsPerMinute) { minutes = seconds/ secondsPerMinute; diff --git a/ui/web/templates/charts/horizontalbarchartmodal.html b/ui/web/templates/charts/horizontalbarchartmodal.html index 5191e335..521e001b 100644 --- a/ui/web/templates/charts/horizontalbarchartmodal.html +++ b/ui/web/templates/charts/horizontalbarchartmodal.html @@ -18,7 +18,7 @@