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> Eltaurus <https://github.com/Eltaurus-Lt>
jariji jariji
Francisco Esteva <fr.esteva@duocuc.cl> 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, daysEnd: daysEnd - 1,
}); });
} else { } else {
const mostRecent = daysEnd <= 0 ? Math.abs(daysEnd - 1) : 0;
const oldest = -daysStart;
return tr.statisticsDaysAgoRange({ return tr.statisticsDaysAgoRange({
daysStart: Math.abs(daysEnd - 1), daysStart: mostRecent,
daysEnd: -daysStart, daysEnd: oldest,
}); });
} }
} }

View file

@ -118,6 +118,10 @@ export function renderCalendar(
// don't fill out future dates // don't fill out future dates
continue; continue;
} }
if (date.getFullYear() != targetYear) {
// only fill blanks for the target year
continue;
}
if (revlogRange == RevlogRange.Year && date < oneYearAgoFromNow) { if (revlogRange == RevlogRange.Year && date < oneYearAgoFromNow) {
// don't fill out dates older than a year // don't fill out dates older than a year
continue; continue;