From aaeac66f6d3f0daf3ac710bfecccba601176234a Mon Sep 17 00:00:00 2001 From: Janik Schumacher Date: Thu, 16 Nov 2023 02:27:58 +0100 Subject: [PATCH] fix --- src/index.ts | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/index.ts b/src/index.ts index 708390b..8db9603 100644 --- a/src/index.ts +++ b/src/index.ts @@ -106,17 +106,6 @@ function getDateInfo(data: DataStruct, date: string) { return data.contributions.find(contrib => contrib.date === date); } -function getContributionCount(graphEntries: GraphEntry[][]) { - return graphEntries.reduce((rowTotal, row) => { - return ( - rowTotal + - row.reduce((colTotal, col) => { - return colTotal + (col.info ? col.info.count : 0); - }, 0) - ); - }, 0); -} - function drawYear(ctx: CanvasRenderingContext2D, opts: DrawYearOptions) { const { year, @@ -160,15 +149,11 @@ function drawYear(ctx: CanvasRenderingContext2D, opts: DrawYearOptions) { ); } if (!opts.skipHeader) { - const count = new Intl.NumberFormat().format( - getContributionCount(graphEntries) - ); - ctx.textBaseline = "hanging"; ctx.fillStyle = theme.text; ctx.font = `10px '${fontFace}'`; ctx.fillText( - `${year.year}: ${count} Contribution${year.total === 1 ? "" : "s"}${ + `${year.year}: ${year.total} Contribution${year.total === 1 ? "" : "s"}${ thisYear === year.year ? " (so far)" : "" }`, offsetX,