From dcc4b6822f9b98c2c393e504debf23d36d3257ed Mon Sep 17 00:00:00 2001 From: brookjeynes Date: Thu, 16 Oct 2025 19:01:08 +1000 Subject: [PATCH] feat(views/stats): update duration numbers to be more human readable Change-Id: mxzpoqmltpmnvrywuvzskynvsokssnyl Signed-off-by: brookjeynes --- .../views/partials/horizonal-bar-chart.templ | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/internal/server/views/partials/horizonal-bar-chart.templ b/internal/server/views/partials/horizonal-bar-chart.templ index 9a027ae..28e5c82 100644 --- a/internal/server/views/partials/horizonal-bar-chart.templ +++ b/internal/server/views/partials/horizonal-bar-chart.templ @@ -11,20 +11,19 @@ templ HorizontalBarChart(params HorizontalBarChartProps) {
for _, item := range params.Data { {{ - widthPercentage := 0.0 - if item.MaxValue > 0 { - widthPercentage = (item.Value.Seconds() / item.MaxValue.Seconds()) * 100 - } + widthPercentage := 0.0 + if item.MaxValue > 0 { + widthPercentage = (item.Value.Seconds() / item.MaxValue.Seconds()) * 100 + } }}
{ item.Label }
-
+
- { item.Value } + + { FormatDuration(item.Value) } +
}
-- 2.43.0