Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Date-Holidays-CZ CPAN distribution.

Report information
The Basics
Id: 92638
Status: open
Priority: 0/
Queue: Date-Holidays-CZ

People
Owner: SMITHFARM [...] cpan.org
Requestors: LRUPP [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.07
Fixed in: (no value)



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...
Hi: Thanks for this bugreport and sorry for the long delay. Date::Holidays::CZ was based on Date::Holidays::DK - that is why it worked the way it did. As of version 0.08 it has been completely rewritten based on Date::Holidays::DE. Give it a try and let me know if it works as you expected. Nathan