File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -163,18 +163,19 @@ function getYearJoined(string $user): int
163
163
*/
164
164
function getContributionStats (array $ contributions ): array
165
165
{
166
- $ today = array_key_last ($ contributions );
166
+ $ today = array_key_last ($ contributions ) ?? date ("Y-m-d " );
167
+ $ first = array_key_first ($ contributions ) ?? date ("Y-m-d " );
167
168
$ stats = [
168
169
"totalContributions " => 0 ,
169
170
"firstContribution " => "" ,
170
171
"longestStreak " => [
171
- "start " => array_key_first ( $ contributions ) ,
172
- "end " => array_key_first ( $ contributions ) ,
172
+ "start " => $ first ,
173
+ "end " => $ first ,
173
174
"length " => 0 ,
174
175
],
175
176
"currentStreak " => [
176
- "start " => array_key_first ( $ contributions ) ,
177
- "end " => array_key_first ( $ contributions ) ,
177
+ "start " => $ first ,
178
+ "end " => $ first ,
178
179
"length " => 0 ,
179
180
],
180
181
];
You can’t perform that action at this time.
0 commit comments