Matthias Dietrich > Date-Holidays-AT-0.1.3 > Date::Holidays::AT

Download:
Date-Holidays-AT-0.1.3.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: v0.1.3   Source  

NAME ^

Date::Holidays::AT - Determine Austrian holidays

SYNOPSIS ^

  use Date::Holidays::AT qw(holidays);
  my $feiertage_ref = holidays();
  my @feiertage     = @$feiertage_ref;

DESCRIPTION ^

This module exports a single function named holidays() which returns a list of Austrian holidays in a given year.

KNOWN HOLIDAYS ^

The module knows about the following holidays:

    neuj = New year's day
    hl3k = Heilige 3 Koenige
    jose = Josef
    tdar = Staatsfeiertag (Tag der Arbeit)
    flor = Florian
    mahi = Mariae Himmelfahrt
    rupe = Rupert
    volk = Tag der Volksabstimmung
    nati = Nationalfeiertag
    alhe = Allerheiligen
    mart = Martin
    leop = Leopold
    maem = Mariae Empfaengnis
    heab = Heiliger Abend
    chri = Christtag
    stef = Stefanitag
    silv = Silvester
    karf = Karfreitag
    ostm = Ostermontag
    himm = Christi Himmelfahrt
    pfim = Pfingstmontag
    fron = Fronleichnam

Please refer to the module source for detailed information about how every holiday is calculated. Too much detail would be far beyond the scope of this document, but it's not particularly hard once you've found the date for Easter.

USAGE ^

OUTPUT FORMAT

The list returned by holidays() consists of UNIX-Style timestamps in seconds since The Epoch. You may pass a strftime() style format string to get the dates in any format you desire:

  my $feiertage_ref = holidays(FORMAT=>"%d.%m.%Y");

This might be considered "hard to use" by some people, so here are a few examples to get you started:

  FORMAT=>"%d.%m.%Y"              25.12.2001
  FORMAT=>"%Y%m%d"                20011225
  FORMAT=>"%a, %B %d"             Tuesday, December 25

Please consult the manual page of strftime() for a complete list of available format definitions.

There is, however, one "proprietary" extension to the formats of strftime(): The format definition %# will print the internal abbreviation used for each holiday.

  FORMAT=>"%#:%d.%m"              wei1:25.12.

As the module doesn't want to deal with i18n issues, you'll have to find your own way to translate the aliases into your local language. See the example/feiertage.pl script included in the Date::Holidays::DE distribution to get the idea. This was added in version 0.6.

ADDITIONAL HOLIDAYS

There are a number of holidays that aren't really holidays, e.g. New Year's Eve and Christmas Eve. These aren't contained in the common set of holidays returnd by the holidays() function. The aforementioned silv and heil are probably the most likely ones that you'll need.

If you want one or several of them to appear in the output from holidays(), use the following:

  my $feiertage_ref = holidays(ADD=>['heil', 'silv']);

SPECIFYING THE YEAR

By default, holidays() returns the holidays for the current year. Specify a year as follows:

  my $feiertage_ref = holidays(YEAR=>2004);

HOLIDAYS ON WEEKENDS

By default, holidays() includes Holidays that occur on weekends in its listing.

To disable this behaviour, set the WEEKENDS option to 0:

  my $feiertage_ref = holidays(WEEKENDS=>0);

COMPLETE EXAMPLE ^

Get all holidays for Ausria in 2004, count New Year's Eve and Christmas Eve as Holidays. Exclude weekends and return the date list in human readable format:

  my $feiertage_ref = holidays(FORMAT   => "%a, %d.%m.%Y"
                               WEEKENDS => 0,
                               YEAR     => 2004,
                               ADD      => ['heil', 'silv']);

PREREQUISITES ^

Uses Date::Calc 5.0 for all calculations. Makes use of the POSIX and Time::Local modules from the standard Perl distribution.

BUGS & SUGGESTIONS ^

If you run into a miscalculation, need some sort of feature or an additional holiday, or if you know of any new changes to the funky holiday situation, please drop the author a note.

LIMITATIONS ^

Date::Calc works with year, month and day numbers exclusively. Even though this module uses Date::Calc for all calculations, it represents the calculated holidays as UNIX timestamps (seconds since The Epoch) to allow for more flexible formatting. This limits the range of years to work on to the years from 1972 to 2037.

Date::Holidays::AT doesn't know anything about past holiday regulations.

Date::Holidays::AT is not configurable. Holiday changes don't come over night and a new module release can be rolled out within a single day.

Date::Holidays::AT probably won't work in Microsoft's "Windows" operating environment.

ACKNOWLEDGEMENTS ^

Thanks to Martin Schmitt <mas at scsy dot de>. Date::Holidays::AT is based on Date::Holidays::DE.

AUTHOR ^

Matthias Dietrich <perl@rainboxx.de>

SEE ALSO ^

perl
Date::Calc
Date::Holidays

COPYRIGHT ^

Copyright 2007 plusW, Rolf Schaufelberger. All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: