Due to a contribution from Wesley Schwengle (waterkip) I am happy to announce release 1.32 of the Date::Holidays Perl distribution.
The release introduces support for:
- Date::Holidays::BQ, a distribution handling holidays for Bonaire.
In addition the adapters for:
- Date::Holidays::NL (Netherlands), Date::Holidays::Adapter::NL
- Date::Holidays::AW (Aruba), Date::Holidays::Adapter::AW
Have had their:
is_holiday
is_holiday_dt
Methods extended with support for additional parameters so the user can specify, the following parameters:
-
gov
for handling special dates influencing government interaction -
lang
so language for holidays names can be specified
Please see the specific documentation for the 3 distributions.
I am happy that waterkip created the PR to have Date::Holidays support the use for the 3 and it outlines one of the features that would be nice to have implemented, namely support for localized holiday names (#12)
Here is a short demo of inquiring whether 2022-12-25 is a holiday in the 3 respective calendars.
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
use Date::Holidays;
my $holidays_hashref = Date::Holidays->is_holiday(
year => 2022,
month => 12,
day => 25,
countries => ['nl', 'bq', 'aw'],
);
print STDERR Dumper($holidays_hashref);
exit 0;
The output:
$VAR1 = {
'aw' => 'Pasco di Nacemento',
'bq' => 'Pasco di Nacemento',
'nl' => 'Kerst'
};
Change log for Date::Holidays.
1.32 2022-10-03 Feature release, update not required
Introduction of Date::Holidays::Adapter::BQ for adapting Date::Holidays::BQ
-
Support for extra parameters for
is_holiday
andis_holiday_dt
:- Date::Holidays::NL via Date::Holidays::Adapter::NL
- Date::Holidays::AW via Date::Holidays::Adapter::AW
- Date::Holidays::BQ via Date::Holidays::Adapter::BQ
All via PR #70 (https://github.com/jonasbn/perl-date-holidays/pull/70) by Wesley Schwengle (@waterkip) author of:
- Date::Holidays::NL
- Date::Holidays::AW
-
Date::Holidays::BQ
- Fixed and clean up to Dist::Zilla configuration by @jonasbn
Top comments (2)
I did a quick follow-up release 1.33 so the
gov
andlang
parameters can now be used in conjunction with the country list parameter. So you can do:Which will then use the
lang
parameter and will output:Meaning the names gets translated.
Do note this is only for:
I really want to look into getting this to work for all adapted Date::Holidas::* distributions.
And a 1.34 release, cleaning up some old stuff making the tests run more smoothly with CPAN testers.
The red markings have gone :-)