Update git commit graph current streak calculation

to no longer break the streak if the current day doesn't have any contributions (yet)
This commit is contained in:
Brad P
2025-04-23 16:32:12 -05:00
committed by GitHub
parent 710918ae89
commit 3dd1fd372b
@@ -77,7 +77,13 @@ module Plugins
def current_streak(days)
streak = 0
days.reverse_each do |day|
# The current day can count towards the streak but it shouldn't break the streak
if (days.last()['contributionCount']).positive?
streak += 1
end
days[0..-2].reverse_each do |day|
break if (day['contributionCount']).zero?
streak += 1