Ruby Haiku - List Specific Days of the Week
Recently I had to populate a drop down menu with the dates of every Sunday for the year up to the present day.
Ruby makes this so freaking easy:
start_date = Date.new(year=2011, month=1, date=1)
end_date = Date.today
my_array = (start_date..end_date).select { |p| [0, 6].include? p.wday }
( Ruby == <3 )
Happy coding!