Skip to content

Instantly share code, notes, and snippets.

@silasb
Created September 28, 2010 03:19
Show Gist options
  • Save silasb/600338 to your computer and use it in GitHub Desktop.
Save silasb/600338 to your computer and use it in GitHub Desktop.
require 'date'
def print_thursday(d1, d2)
d1 += 1 while (d1.wday != 4)
d1.step(d2, 7) do |date|
puts "#{Date::MONTHNAMES[date.mon]} #{date.day}"
end
end
print_thursdays(Date.today, Date::civil(2011, 5, 23))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment