Rand Stats

Holidays::Miscellaneous

zef:tbrowder

Actions Status Actions Status Actions Status

NAME

Holidays::Miscellaneous - Provides perpetual data for miscellaneous holidays

SYNOPSIS

use Holidays::Miscellaneous;
use UUID::V4;

my $year = 2025;
my $set-id = uuid-v4; # A unique ID for the set of holidays so they can be
                      # merged with other C<Date::Event> sets for calendar
                      # generation;
my %mh = get-misc-holidays :$year, :$set-id;
# Keys of the '%us' hash are the C<$year>'s dates with holidays
my @d = %mh.keys.sort({$^a cmp $^b}); # Get array in date order
for @d -> $D {
    my Date $date .= new: $D; # Get the Date
    my %h = %mh{$date};
    # The value of %h is another hash keyed by: ($set-id ~ '|' ~ $id)
    # but we only break that key down for testing.
    #    %h{$h.date}{$key} = $holiday;
    my $holiday;
    for %h.keys -> $key {
        $holiday = %h{$key}; # The C<MiscHoliday> class object (a C<Date::Event>)
        # use the data for a calendar day cell
        my $d  = $holiday.date;
        my $n  = $holiday.name;
        my $ns = $holiday.short-name;
    }
}

DESCRIPTION

Holidays::Miscellaneous is a collection of holiday data the author uses for perpetual calendar creation. (The term perpetual is used to mean the source code to generate the calendar's holiday dates is valid for any given year since the code uses the documented rules for determining those dates and no additional data need be inserted in the code annually.)

Note the names and dates of the holidays are those customarily used in the U.S., but several of those holidays are commonly celebrated in other countries around the world.

Current holiday list

Holidays marked with a leading '*' are classified as 'calculated' holidays since their observed dates vary from year to year. This module uses module Date::Utils for that calculation.

The holidays without the leading asterisk are classified as 'directed' or 'fixed' since they are always on fixed dates.

SEE ALSO

Related Raku modules by the author:

AUTHOR

Tom Browder tbrowder@acm.org

COPYRIGHT AND LICENSE

© 2024 Tom Browder

This library is free software; you may redistribute it or modify it under the Artistic License 2.0.