Fix calculation of start date in ContributionCalendar to correctly reflect the 52-week period

This commit is contained in:
2025-06-24 21:11:05 +02:00
parent 3847f415d6
commit dde3fb1923

View File

@@ -10,7 +10,7 @@ function getCalendarDays() {
// Find the Monday that starts our 52-week period
const startDate = new Date(todayUTC);
startDate.setUTCDate(todayUTC.getUTCDate() - (52 * 7 - 1));
startDate.setUTCDate(todayUTC.getUTCDate() - (51 * 7 - 1));
// Adjust startDate to the Monday of that week (using UTC day)
const startDayOfWeek = startDate.getUTCDay(); // 0 = Sunday, 1 = Monday, etc.