Date::Holidays::ES - Spanish holidays
use Date::Holidays; my $dh = Date::Holidays->new( countrycode => 'es' ); print "Woohoo" if $dh->is_holiday( year => $year, month => $month, day => $day ); my $h = $dh->holidays( year => $year ); printf "Jan. 1st is named '%s'\n", $h->{'0101'};
This module provide the Spanish national holidays. You should use it with the Date::Holidays OO wrapper, but you can also use it directly.
The following Spanish holidays have fixed dates:
1 Jan Año Nuevo 1 May Día del Trabajo 12 Oct Día de la Hispanidad 1 Nov Día de Todos los Santos 6 Dec Día de la Constitución 8 Dec Día de la Inmaculada Concepción 25 Dec Navidad
The following Spanish holiday hasn't a fixed date:
Viernes Santo Friday before Pascua / Easter
Create a new Date::Holydays::ES object.
if ( $dh->is_holiday( year => $year, month => $month, day => $day ) ) { # it's a holiday }
Arguments:
year (four digits) month (between 1-12) day (between 1-31)
The return value from is_holiday is either the string with the holiday name or an undefined value.
A wrapper of the is_holiday method. Not available through Date::Holidays.
my $yh = $dh->holidays( year => $year ); for (keys %$yh) { my ($day, $month) = unpack "A2A2", $_; print "$day/$month - $yh->{$_}\n"; }
year (four digits)
Returns a hash reference, where the keys are dates represented as four digits, the two first representing the month (01-12) and the last two representing the day (01-31).
The value for a given key is the local name for the holiday.
A wrapper of the holidays function. Not available through Date::Holidays.
my $dh = Date::Holidays::ES->new; my $yho = $dh->holidays_es( year => $year ); for my $holiday (sort keys %$yho) { my $dt = $yho->{$holiday}; my $year = $dt->year; my $month = $dt->month; my $day = $dt->day; print "$holiday is on $day/$month/$year\n"; }
This method is not available through Date::Holidays' interface.
Returns a hash reference, where the keys are the holidays name and the values are DateTime objects.
Date::Holidays, DateTime
jonasbn, <jonasbn@cpan.org>, current maintainer
Florian Merges, <fmerges@cpan.org>
Copyright since 2007 Florian Merges, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Date::Holidays::ES, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Date::Holidays::ES
CPAN shell
perl -MCPAN -e shell install Date::Holidays::ES
For more information on module installation, please visit the detailed CPAN module installation guide.