NAME

Date::Holidays - a Date::Holidays::* OOP wrapper

SYNOPSIS

use Date::Holidays;

my $dh = Date::Holidays->new(
	countrycode => 'dk'
);

$dh->is_holiday(
	year  => 2004,
	month => 12,
	day   => 25
);

$dh->holidays(
	year => 2004
);

DESCRIPTION

These are the methods implemented in this class. They act as wrappers around the different modules implementing different national holidays, and at the same time they provide an OOP interface.

As described below is requires that a certain API is implemented (SEE: holidays and is_holiday below).

If you are an author who wants to comply to this suggestion, either look at some of the other modules in the Date::Holidays::* namespace and Date::Holidays::Abstract - or write me.

new

This is the constructor. It takes the following parameters:

countrycode, two letter unique code representing a country name. Please refer to ISO3166 (or Locale::Country)

The constructor loads the module from Date::Holidays::*, which matches the country code.

holidays

This is a wrapper around the loaded module's holidays method if this is implemented. If this method is not implemented it trues <countrycode>_holidays.

Takes one named argument:

year, four digit parameter representing year

holidays_dt *EXPERIMENTAL*

This method is similar to holidays. It takes one named argument b<year>.

The result is a hashref just as for holidays, but instead the names of the holidays are used as keys and the values are DateTime objects.

is_holiday

This is yet another wrapper around the loaded module's is_holiday method if this is implemented. Also if this method is not implemented it tries is_<countrycode>_holiday.

Takes 3 arguments:

year, four digit parameter representing year
month, 1-12, representing month
day, 1-31, representing day

is_holiday_dt *EXPERIMENTAL*

This method is similar to is_holiday, but instead of 3 separate arguments is only takes a single argument, a DateTime object.

Return 1 for true if the object is a holiday and 0 for false if not.

SEE ALSO

Date::Holidays::DE
Date::Holidays::DK
Date::Holidays::FR
Date::Holidays::NO
Date::Holiday::PT
Date::Holidays::UK
Date::Japanese::Holiday
Date::Holidays::Abstract
Date::Holidays::Super
DateTime

BUGS

Please report issues via CPAN RT:

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Date-Holidays

or by sending mail to

bug-Date-Holidays@rt.cpan.org

AUTHOR

Jonas B. Nielsen, (jonasbn) - <jonasbn@cpan.org>

COPYRIGHT

Date-Holidays is (C) by Jonas B. Nielsen, (jonasbn) 2004

Date-Holidays is released under the artistic license

The distribution is licensed under the Artistic License, as specified by the Artistic file in the standard perl distribution (http://www.perl.com/language/misc/Artistic.html).