From 29b5c3de1cf8b7f082ae7dd2b7105b02a63e21d7 Mon Sep 17 00:00:00 2001 From: Orne Brocaar Date: Wed, 28 Aug 2024 14:40:22 +0100 Subject: [PATCH] ui: Fix tooltip date formatting. With the migration from moment to date-fns (#460) some of the formatting strings were not updated accordingly. Fixes #503. --- ui/src/components/MetricChart.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ui/src/components/MetricChart.tsx b/ui/src/components/MetricChart.tsx index 41f6a678..a45eb577 100644 --- a/ui/src/components/MetricChart.tsx +++ b/ui/src/components/MetricChart.tsx @@ -15,16 +15,16 @@ interface IProps { function MetricChart(props: IProps) { let unit: TimeUnit = "hour"; - let tooltipFormat = "LT"; + let tooltipFormat = "p"; if (props.aggregation === Aggregation.DAY) { unit = "day"; - tooltipFormat = "MMM Do"; + tooltipFormat = "MMM d"; } else if (props.aggregation === Aggregation.MONTH) { unit = "month"; - tooltipFormat = "MMM YYYY"; + tooltipFormat = "MMM yyyy"; } else if (props.aggregation === Aggregation.MINUTE) { unit = "minute"; - tooltipFormat = "LT"; + tooltipFormat = "p"; } const animation = false as const; @@ -59,8 +59,6 @@ function MetricChart(props: IProps) { .sort((a, b) => a.getLabel().localeCompare(b.getLabel())) .map((v, i) => { const colors = palette("cb-Paired", props.metric.getDatasetsList().length).map((hex: string) => "#" + hex); - console.log(v.getLabel()); - console.log(colors[i]); return { label: v.getLabel(),