Subject: | rt.cpan.org #45677 Few holidays in Date::Holidays::USFederal |
Date: | Sun, 3 May 2009 15:33:58 -0700 (PDT) |
To: | bug-Date-Holidays-USFederal [...] rt.cpan.org |
From: | mbaguide2000-web [...] yahoo.com |
OK, so:
$holiday = is_usfed_holiday(&UnixDate($day, "%Y"), sprintf("%d", &UnixDate($day, "%m")), sprintf("%d", &UnixDate($day, "%d"))) ;
The module does not support month or day values with leading zeros:
% holidays.pl
2009 1 1 : New Year's Day
2009 1 1 : Martin Luther King, Jr. Birthday
2009 2 2 : Washington's Birthday / Presidents Day
2009 5 5 : Memorial Day
2009 7 7 : Independence Day
2009 9 9 : Labor Day
2009 10 10 : Columbus Day
2009 11 11 : Veterans Day
2009 11 11 : Thanksgiving Day
2009 12 12 : Christmas Day
-Dave
--- On Sun, 5/3/09, mbaguide2000-web@yahoo.com <mbaguide2000-web@yahoo.com> wrote:
Show quoted text
> From: mbaguide2000-web@yahoo.com <mbaguide2000-web@yahoo.com>
> Subject: Few holidays in Date::Holidays::USFederal
> To: bug-Date-Holidays-USFederal@rt.cpan.org
> Date: Sunday, May 3, 2009, 3:03 PM
> Mac OS X Version 10.5.6
>
> % perl -version
>
> This is perl, v5.8.8 built for darwin-thread-multi-2level
> (with 2 registered patches, see perl -V for more detail)
>
>
> The module seems to know about only 4 holidays:
>
> % holidays.pl
> 2009 10 12: Columbus Day
> 2009 11 11: Veterans Day
> 2009 11 26: Thanksgiving Day
> 2009 12 25: Christmas Day
>
> % holidays.pl
> 2008 10 13: Columbus Day
> 2008 11 11: Veterans Day
> 2008 11 27: Thanksgiving Day
> 2008 12 25: Christmas Day
>
>
> #!/usr/bin/perl
>
> use Date::Manip;
> use Date::Holidays::USFederal;
>
> # $day = "2009010100:00:00" ;
>
> $day = "2008010100:00:00" ;
>
> # while (&UnixDate($day, "%Y") eq
> "2009")
>
> while (&UnixDate($day, "%Y") eq
> "2008")
> {
> $holiday = is_usfed_holiday(&UnixDate($day,
> "%Y"), &UnixDate($day, "%m"),
> &UnixDate($day, "%d")) ;
>
> if (length($holiday)) { print &UnixDate($day, "%Y
> %m %d: $holiday\n") ; }
> elsif (is_usfed_holiday(&UnixDate($day,
> "%Y"), &UnixDate($day, "%m"),
> &UnixDate($day, "%d")))
> {
> print "$day is an un-named holiday\n" ;
> }
> # else
> # {
> # print &UnixDate($day, "%Y %m %d\n")
> ;
> # }
>
> $day = &DateCalc($day,"+ 1 day",\$err) ;
> }