[Chicago-talk] Calculating Holidays

Jay Strauss me at heyjay.com
Thu Jul 12 17:53:35 PDT 2012


Richard, I get the feeling you are looking for a module with built in
knowledge of the dates of various holidays.  I'm not sure if such a
thing exists. (admittedly I haven't searched)

The docs for DateTime::Event::Holiday::US; seem like it just a module
for naming dates and proving a wrapper to the underlying  modules

I think you need a module that let's you supply a calendar (dates with
names) and then gives you functions for navigating that calendar


Thanks
Jay

Sent from my iPhone

On Jul 12, 2012, at 12:34 PM, Richard Reina <richard at rushlogistics.com> wrote:

>
> Hi Mike,
>
> Thank you very much for the suggestion.  With some difficulty I was able to get the module installed. However, I am unclear on how it works.  The example given in the docs:
>
> use DateTime::Event::Holiday::US;
>
> my $thanksgiving = DateTime::Event::Holiday::US::holiday( 'Thanksgiving' );
>
>
> gives me a hash reference which when I try to dereference with:
>
> my %hash =  %$thanksgiving;
>
> foreach my $k (keys %hash) {
>        print "$k: $hash{$k}\n";
>    }
>
>
> gives me:
>
> as_ical: ARRAY(0x1e63190)
> set: Too complex
>
> I was hoping it might give me the date for Thanksgiving.
>
> If any one can give me an idea as to what I am doing wrong in trying to use this module I would really appreciate it.
>
> Thanks,
>
> Richard
>
>
>
>>
>> Mike Fragassi <mikefrag at gmail.com> wrote:
>
>> Try DateTime::Event::Holiday::US.
>
>> On Jul 3, 2012 3:46 PM, <richard at rushlogistics.com> wrote:
>>
>> I am lost trying to write a simple script that tells
>> me how many days until the next approaching holiday.
>> has anyone ever done anything similar or know of anything
>> helpful. I've looked at Date::Manip but that still
>> leaves me with the cumbersome task of finding out
>> which holiday is the next one from a given date.
>>
>> Any help would be appreciated as not solving it will
>> keep me preoccupied all through the holiday.
>>
>> Thanks
>>
>> Richard
>> _______________________________________________
>> Chicago-talk mailing list
>> Chicago-talk at pm.org
>> http://mail.pm.org/mailman/listinfo/chicago-talk
>
>
> --
> Richard Reina
> Rush Logistics, Inc.
> Watch our 3 minute movie:
> http://www.rushlogistics.com/movie
>
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk


More information about the Chicago-talk mailing list