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 9facea0a66
commit 0abac06c39
3 changed files with 9 additions and 2 deletions

View file

@ -255,6 +255,7 @@ Ranjit Odedra <ranjitodedra.dev@gmail.com>
Eltaurus <https://github.com/Eltaurus-Lt>
jariji
Francisco Esteva <fr.esteva@duocuc.cl>
Junia Mannervik <junia.mannervik@gmail.com>
********************

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;