[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ANN: Holidays 0.9.1 released and call for contributors

Alex Dunae

1/15/2008 4:57:00 AM

The Ruby holidays gem has been released and I'm looking for
contributors to help create regional holiday definition files. This
gem provides a set of functions for looking up public holidays around
the world.

A quick example:

require 'holidays'
require 'holidays/ca'

# Lookup Canada Day
date = Date.civil(2007,7,1)
Holidays.by_day(date, :ca)
=> [{:name => 'Canada Day',...}]

# Canada Day is July 1 except when July 1 is a Sunday, then it moves
to
# July 2
date = Date.civil(2007,7,2)
Holidays.by_day(date, :ca, :observed)
=> [{:name => 'Canada Day',...}]

# Check if this is a holiday in British Columbia, Canada
date.holiday?(:ca_bc)
=> true

There are a lot of countries in the world and contributors are invited
to create or improve a holiday definition file for any region. Sample
definition files can be found at http://code.dunae.ca/svn/holidays/t...
- get in touch if you would like to help out: alex [at] dunae dot ca.

The project page is here: http://code.dunae.ca...
The docs are here: http://code.dunae.ca...doc/