Skip Menu |

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

Report information
The Basics
Id: 27572
Status: open
Priority: 0/
Queue: Date-Holidays-NZ

People
Owner: Nobody in particular
Requestors: paul.dorman [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.00
Fixed in: (no value)



Subject: Request for enhancement - holiday name from date
For some strange reason, there's no consistent way of getting a regional holiday name out of this module. I can get a national holiday name with something like: my $holiday_name = nz_holidays($yyyy)->{$month.$day} but this doesn't work for regional holidays ($holiday_name is undefined). Rather than fix this function, how about make is_nz_holiday return the name of the holiday if it is one, or undef if it's not. I don't know if this stupid bug tracker emails me updates, so please email me at paul<d0t)dorman[at)gmail#dot}com if you're keen to make this improvement.
From: SAMV [...] cpan.org
On Wed Jun 13 23:07:39 2007, paul.dorman wrote: Show quoted text
> For some strange reason, there's no consistent way of getting a regional > holiday name out of this module. I can get a national holiday name with > something like: > > my $holiday_name = nz_holidays($yyyy)->{$month.$day} > > but this doesn't work for regional holidays ($holiday_name is undefined). > > Rather than fix this function, how about make is_nz_holiday return the > name of the holiday if it is one, or undef if it's not. > > I don't know if this stupid bug tracker emails me updates, so please > email me at paul<d0t)dorman[at)gmail#dot}com if you're keen to make this > improvement.
Currently if you want a holidays hash that includes a regional holiday, you have to pass the region in as a second argument to nz_holidays. I have clarified this in the documentation. If you think there is room for a feature for the module to return all regional holidays in the same hash, please feel free to submit a test script, preferably as a patch against the distribution. Cheers, Sam.