Skip to content

Instantly share code, notes, and snippets.

@gabetax
Created January 3, 2013 21:40
Show Gist options
  • Save gabetax/4447578 to your computer and use it in GitHub Desktop.
Save gabetax/4447578 to your computer and use it in GitHub Desktop.
Custom holidays with the holidays gem
---
months:
0:
- name: Mardi Gras
regions: [bank]
function: easter(year)-47
11:
- name: Black Friday
week: -1
regions: [bank]
wday: 5
tests: |
{Date.civil(2013,2,12) => 'Mardi Gras',
Date.civil(2013,11,29) => 'Black Friday'}.each do |date, name|
assert_equal name, (Holidays.on(date, :bank)[0] || {})[:name]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment