From 0c482960ce840698dcb758746830933bff574207 Mon Sep 17 00:00:00 2001 From: waclaw66 Date: Mon, 13 Nov 2023 16:37:50 +0100 Subject: [PATCH] fix(web): better year labels (#5009) * better year labels * fixes * lint fixes --- .../scrollbar/scrollbar.svelte | 76 +++++++++---------- 1 file changed, 34 insertions(+), 42 deletions(-) diff --git a/web/src/lib/components/shared-components/scrollbar/scrollbar.svelte b/web/src/lib/components/shared-components/scrollbar/scrollbar.svelte index 580277fba9..7dfd34e8f6 100644 --- a/web/src/lib/components/shared-components/scrollbar/scrollbar.svelte +++ b/web/src/lib/components/shared-components/scrollbar/scrollbar.svelte @@ -1,5 +1,6 @@ @@ -125,11 +120,8 @@ /> {/if} - {#each segments as segment, index (segment.timeGroup)} - {@const date = fromLocalDateTime(segment.timeGroup)} - {@const year = date.year} - {@const label = `${date.toLocaleString({ month: 'short' })} ${year}`} - {@const lastGroupYear = fromLocalDateTime(segments[index - 1]?.timeGroup).year} + {#each segments as segment} + {@const label = `${segment.date.toLocaleString({ month: 'short' })} ${segment.date.year}`}
(hoverLabel = label)} > - {#if lastGroupYear !== year && (index == 0 || prevYearSegmentHeight(segments, index - 1) > 16)} + {#if segment.hasLabel}
- {year} + {segment.date.year}
{:else if segment.height > 5}