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
163163 */
164164function getContributionStats (array $ contributions ): array
165165{
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 " );
167168 $ stats = [
168169 "totalContributions " => 0 ,
169170 "firstContribution " => "" ,
170171 "longestStreak " => [
171- "start " => array_key_first ( $ contributions ) ,
172- "end " => array_key_first ( $ contributions ) ,
172+ "start " => $ first ,
173+ "end " => $ first ,
173174 "length " => 0 ,
174175 ],
175176 "currentStreak " => [
176- "start " => array_key_first ( $ contributions ) ,
177- "end " => array_key_first ( $ contributions ) ,
177+ "start " => $ first ,
178+ "end " => $ first ,
178179 "length " => 0 ,
179180 ],
180181 ];
You can’t perform that action at this time.
0 commit comments