I am currently doing this:
x = Date.today
y = x + 12.weeks
(x..y).each do |date|
next unless date.strftime("%A") == 'Friday'
@dates << date
end
There has to be better code to do this, can anyone give it to me or give me the right thing to look for to find how to do it?
Thanks
Nice one-liner:
(Date.today..Date.today + 12.weeks).select(&:friday?)– Voila!