Skip to content

Commit

Permalink
Check if date is in the future
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlgo11 committed Feb 23, 2022
1 parent 1447818 commit f4726db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ def fetch_github_activity(length)
html = Oga.parse_html(URI.open("https://github.com/#{fetch_var('GITHUB_USER')}"))
days = []
boxes = html.css('rect.ContributionCalendar-day')
boxes.each { |item| days << Integer(item['data-level']) unless item['data-date'].nil? }
boxes.each do |item|
days << Integer(item['data-level']) unless item['data-date'].nil? || Date.parse(item['data-date']) > Date.today
end
days.last(length)
end

Expand Down

0 comments on commit f4726db

Please sign in to comment.