Subject: | Date::Holidays::CZ misses the holidays() function |
I have the following snipplet to print out German holidays based on Date::Holidays::DE:
-----------------------------------[snip]
#!/usr/bin/perl
use Date::Holidays::DE qw(holidays);
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year+=1900;
my $year = $ARGV[0] || $year;
my $feiertage_ref = holidays( WHERE => ['common', 'nw'],
FORMAT => "%Y-%m-%d\t\t00:00-24:00\t\t;%#",
WEEKENDS => 0,
YEAR => $year);
# ADD => ['heil', 'silv', 'mari']);
my @feiertage = @$feiertage_ref;
foreach(@feiertage) {
print "\t\t$_\n";
}
print "\n";
-----------------------------------[snap]
This does not work for Date::Holidays::CZ - instead I need the following snipplet to reach the same:
-----------------------------------[snip]
#!/usr/bin/perl
use Date::Holidays::CZ qw(cz_holidays);
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
my $year=$year+1900;
our $year = $ARGV[0] || $year ;
my $hashref = cz_holidays($year);
foreach my $keys (sort(keys(%$hashref))){
my ($fo,$month,$day)=split(/(\d\d)/,$keys,2);
print " $year-$month-$day\t\t00:00-24:00;\t $hashref->{$keys}\n";
}
print "\n";
-----------------------------------[snap]
Would be cool if I could unify the snipplets...