Skip to content

Instantly share code, notes, and snippets.

@dennyabraham
Created October 29, 2013 03:02
Show Gist options
  • Save dennyabraham/7208561 to your computer and use it in GitHub Desktop.
Save dennyabraham/7208561 to your computer and use it in GitHub Desktop.
require 'date'
def second_wednesday_of(month, year)
month_start = Date.new(year, month)
day_number = (1..14).select do |offset|
(month_start + offset).wednesday?
end.last
month_start + day_number
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment