Skip to content

Instantly share code, notes, and snippets.

@Prigin
Created October 17, 2019 17:01
Show Gist options
  • Save Prigin/91ce82b2c05efae7b8abc27eb2f767e6 to your computer and use it in GitHub Desktop.
Save Prigin/91ce82b2c05efae7b8abc27eb2f767e6 to your computer and use it in GitHub Desktop.
bit of code
months = [["jan", 0],["feb", 0], ["mar", 0], ["apr", 0], ["may", 0], ["jun", 0],
["jul", 0], ["aug", 0], ["sep", 0], ["oct", 0], ["nov", 0], ["dec", 0]]
mas.each do |unit|
months.each_index{|index| months[index][1] += 1 if index + 1 == unit.date.split("-")[1].to_i}
end
months.each{|unit| p unit}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment