From a71203c6f190e8b9c567663d28100945750a6a24 Mon Sep 17 00:00:00 2001 From: junlu592 Date: Sat, 15 Nov 2025 12:51:21 +0100 Subject: [PATCH] Fixed overlapping ranges when all history is selected and days calcolation to prevent overlapping labels --- ts/lib/tslib/time.ts | 6 ++++-- ts/routes/graphs/calendar.ts | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ts/lib/tslib/time.ts b/ts/lib/tslib/time.ts index 25d70eef3..0e6330f38 100644 --- a/ts/lib/tslib/time.ts +++ b/ts/lib/tslib/time.ts @@ -178,9 +178,11 @@ export function dayLabel(daysStart: number, daysEnd: number): string { daysEnd: daysEnd - 1, }); } else { + const mostRecent = daysEnd <= 0 ? Math.abs(daysEnd - 1) : 0; + const oldest = -daysStart; return tr.statisticsDaysAgoRange({ - daysStart: Math.abs(daysEnd - 1), - daysEnd: -daysStart, + daysStart: mostRecent, + daysEnd: oldest, }); } } diff --git a/ts/routes/graphs/calendar.ts b/ts/routes/graphs/calendar.ts index 863923095..14c32d089 100644 --- a/ts/routes/graphs/calendar.ts +++ b/ts/routes/graphs/calendar.ts @@ -118,6 +118,10 @@ export function renderCalendar( // don't fill out future dates continue; } + if (date.getFullYear() != targetYear) { + // only fill blanks for the target year + continue; + } if (revlogRange == RevlogRange.Year && date < oneYearAgoFromNow) { // don't fill out dates older than a year continue;