Introducing the holidays gem

Example

require 'holidays'

from = Date.civil(2014,1,1)
to = Date.civil(2014,12,31)
puts Holidays.between(from, to, :gb).join("\n")

Output

{:date=>#<Date: 2014-01-01 ((2456659j,0s,0n),+0s,2299161j)>, :name=>"New Year's Day", :regions=>[:au, :gb, :ca]}
{:date=>#<Date: 2014-04-18 ((2456766j,0s,0n),+0s,2299161j)>, :name=>"Good Friday", :regions=>[:au, :gb, :ca]}
{:date=>#<Date: 2014-04-20 ((2456768j,0s,0n),+0s,2299161j)>, :name=>"Easter Sunday", :regions=>[:gb]}
{:date=>#<Date: 2014-05-05 ((2456783j,0s,0n),+0s,2299161j)>, :name=>"May Day", :regions=>[:au_nt, :gb]}
{:date=>#<Date: 2014-05-26 ((2456804j,0s,0n),+0s,2299161j)>, :name=>"Bank Holiday", :regions=>[:gb]}
{:date=>#<Date: 2014-12-25 ((2457017j,0s,0n),+0s,2299161j)>, :name=>"Christmas Day", :regions=>[:gb]}
{:date=>#<Date: 2014-12-26 ((2457018j,0s,0n),+0s,2299161j)>, :name=>"Boxing Day", :regions=>[:gb]}

Resources

Tags:
Source:
0739hrs.txt
Published:
25-12-2013 07:39