Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Bug] streak greater than 366 days
Fix this bug by adding check for max 31 Dec
  • Loading branch information
trueberryless authored Jan 3, 2025
commit e284484806387adc2436a3cca91d064028816166
2 changes: 1 addition & 1 deletion src/pages/api/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default async function GET(request: Request): Promise<NextResponse> {
const contributionDays =
userData.contributionsCollection.contributionCalendar.weeks
.flatMap((week: any) => week.contributionDays)
.filter((day: any) => new Date(day.date) >= new Date("2024-01-01"));
.filter((day: any) => new Date(day.date) >= new Date("2024-01-01") && new Date(day.date) <= new Date("2024-12-31"));

// Calculate monthly contribution statistics
const monthlyCommits: Record<string, number> = {};
Expand Down