Fixed overlapping ranges when all history is selected and days calcolation to prevent overlapping labels

This commit is contained in:
junlu592 2025-11-15 12:51:21 +01:00
parent 26e5ae2f67
commit a71203c6f1
2 changed files with 8 additions and 2 deletions

View file

@ -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,
});
}
}

View file

@ -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;