Scroll to navigation

Date::Holidays::CZ(3) User Contributed Perl Documentation Date::Holidays::CZ(3)

NAME

Date::Holidays::CZ - Determine Czech holidays

SYNOPSIS

  use Date::Holidays::CZ qw(holidays);
  my $svatky_ref = holidays();
  my @svatky     = @$svatky_ref;

DESCRIPTION

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

VERSION

Version 0.13

KNOWN HOLIDAYS

Czech names

The module knows about the following holidays (official names):

  obss Den obnovy samostatneho Xeskeho statu
  velk VelikonoXni patek
  veln VelikonoXni nedXle
  velp VelikonoXni pondXli
  svpr Svatek prace
  devi Den vitXzstvi
  cyme Den slovanskych vXrozvXstX Cyrila a MetodXje
  mhus Den upaleni mistra Jana Husa
  wenc Den Xeske statnosti
  vzcs Den vzniku samostatneho Xeskoslovenskeho statu
  bojs Den boje za svobodu a demokracii
  sted XtXdry den 
  van1 1. svatek vanoXni
  van2 2. svatek vanoXni

English names

The module knows about the following holidays (English names):

  obss Restoration Day of the Independent Czech State
  velk Good Friday
  veln Easter Sunday
  velp Easter Monday
  svpr Labor Day
  dvit Liberation Day
  cyme Saints Cyril and Methodius Day
  mhus Jan Hus Day
  wenc Feast of St. Wenceslas (Czech Statehood Day)
  vzcs Independent Czechoslovak State Day
  bojs Struggle for Freedom and Democracy Day
  sted Christmas Eve
  van1 Christmas Day
  van2 Feast of St. Stephen

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 $svatky_ref = holidays(FORMAT=>"%d.%m.%Y");

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"              van1: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/svatky.pl script included in the distribution to get the idea.

SPECIFYING THE YEAR

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

  my $svatky_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 $svatky_ref = holidays(WEEKENDS=>0);

COMPLETE EXAMPLE

Get all holidays in 2004, except those that occur on weekends. Return the date list in human readable format:

  my $feiertage_ref = holidays( FORMAT   => "%a, %d.%m.%Y",
                                WEEKENDS => 0,
                                YEAR     => 2004,
                              );

PREREQUISITES

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

FUNCTIONS

holidays

Returns a list of Czech holidays in a given year.

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 our funky holiday situation, please drop the author a note.

Patches are welcome. If you can, please fork the project on github to submit your change:

  http://github.com/smithfarm/Date-Holidays-CZ

OFFICIAL HOLIDAY INFORMATION

The authority for Czech holidays is the Parliament of the Czech Republic, which sets the holidays by decree of law.

The official list of list of Czech holidays is available at:

  http://www.mpsv.cz/cs/74

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::CZ is not configurable. Holiday changes don't come overnight and a new module release can be rolled out within a single day.

AUTHOR

Nathan Cutler <ncutler@suse.com>

SEE ALSO

perl, Date::Calc.

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Non-ASCII character seen before =encoding in 'samostatneho'. Assuming UTF-8
2016-04-23 perl v5.26.1