The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

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.

LOCAL HOLIDAYS

The module also knows about different regulations throughout Austria

When calling holidays(), the resulting list by default contains the list of Austria-wide holidays.

You can specify one ore more of the following federal states to get the list of holidays local to that state:

  B    Burgenland
  K    Kaernten
  NOE  Niederoesterreich
  OOE  Oberoesterreich
  S    Salzburg
  ST   Steiermark
  T    Tirol
  W    Wien

For example,

  my $feiertage_ref = holidays(WHERE=>['W', 'S']);

returns the list of holidays local to Wien or Salzburg.

To get the list of local holidays along with the default list of common Austrian holidays, use the following:

  my $feiertage_ref = holidays(WHERE=>['common', 'ST']);

returns the list of common Austrian holidays merged with the list of holidays specific to Steiermark.

You can also request a list containing all holidays this module knows about:

  my $feiertage_ref = holidays(WHERE=>['all']);

will return a list of all known holidays.

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 heab 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=>['heab', '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"
                               WHERE    => ['common'],
                               WEEKENDS => 0,
                               YEAR     => 2004,
                               ADD      => ['heab', '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.