Scroll to navigation

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

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.20

KNOWN HOLIDAYS

Czech names

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

  obss Den obnovy samostatného českého státu
  velk Velikonoční pátek
  veln Velikonoční neděle
  velp Velikonoční pondělí
  svpr Svátek práce
  devi Den vítězství
  cyme Den slovanských věrozvěstů Cyrila a Metoděje
  mhus Den upálení mistra Jana Husa
  wenc Den české státnosti
  vzcs Den vzniku samostatného československého státu
  bojs Den boje za svobodu a demokracii
  sted Štědrý den 
  van1 1. svátek vánoční
  van2 2. svátek vánoční

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 $svatky_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>

LICENSE

The code in this module is based heavily on Date::Holidays::DE version 0.16 by Martin Schmitt. That code is governed by the following license:

    Copyright (c) 2012, Martin Schmitt <mas at scsy dot de>, 
    including patches contributed by Marc Andre Selig, Oliver Paukstadt,
    Tobias Leich and Christian Loos
  
    Permission to use, copy, modify, and/or distribute this software for any
    purpose with or without fee is hereby granted, provided that the above
    copyright notice and this permission notice appear in all copies.
  
    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
    WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
    MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
    ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
    ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

All modifications to the original Date::Holidays::DE code, as well as all new code, are governed by the following:

    Copyright (c) 2015-2020, SUSE LLC
    All rights reserved.
  
    This is free software, licensed under:
  
      The (three-clause) BSD License
  
    The BSD License
  
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions are
    met:
  
      * Redistributions of source code must retain the above copyright
        notice, this list of conditions and the following disclaimer.
  
      * Redistributions in binary form must reproduce the above copyright
        notice, this list of conditions and the following disclaimer in the
        documentation and/or other materials provided with the distribution. 
  
      * Neither the name of SUSE LLC nor the names of its contributors may 
        be used to endorse or promote products derived from this software 
        without specific prior written permission. 
  
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
    IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
    TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
    PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 
    OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

SEE ALSO

perl, Date::Calc.

2020-02-18 perl v5.40.0