Browse files

Oliver Paukstadt added religious "silent days"

- Ash wednesday
- Maundy Thursday
- Holy Saturday
- Remembrance Day, German Style
- Sunday in commemoration of the dead
- 4 Sundays of Advent
  • Loading branch information...
1 parent 476ce92 commit f07c5f686b10eb8f7f7d5e12f6698d93e9e19b73 @mschmitt mschmitt committed Aug 15, 2010
Showing with 75 additions and 7 deletions.
  1. +3 −0 CPAN_checklist.txt
  2. +9 −0 Changes
  3. +47 −1 DE.pm
  4. +7 −6 README
  5. +9 −0 example/feiertage.pl
View
3 CPAN_checklist.txt
@@ -0,0 +1,3 @@
+- Version in DE.pm
+- Changes
+- make clean; perl Makefile.PL; make dist
View
9 Changes
@@ -28,3 +28,12 @@ v1.2 Sun Nov 8 08:22:34 CET 2009
v1.3 Sat Apr 17 18:34:33 2010 +0200
- Added Augsburg Peace Day as optional local holiday.
Requested and patch kindly provided by Marc André Selig.
+
+v1.4 Sun Aug 15 13:12:47 CEST 2010
+ - Oliver Paukstadt added religious "silent days"
+ - Ash wednesday
+ - Maundy Thursday
+ - Holy Saturday
+ - Remembrance Day, German Style
+ - Sunday in commemoration of the dead
+ - 4 Sundays of Advent
View
48 DE.pm
@@ -14,7 +14,7 @@ require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(holidays);
-our $VERSION = '1.3.1';
+our $VERSION = '1.4';
sub holidays{
my %parameters = (
@@ -34,7 +34,10 @@ sub holidays{
# hl3k = Dreikoenigstag
# romo = Rosenmontag
# fadi = Faschingsdienstag
+ # asmi = Aschermittwoch
+ # grdo = Gruendonnerstag
# karf = Karfreitag
+ # kars = Karsamstag
# osts = Ostersonntag
# ostm = Ostermontag
# pfis = Pfingstsonntag
@@ -49,6 +52,12 @@ sub holidays{
# refo = Reformationstag
# alhe = Allerheiligen
# buss = Buss- und Bettag
+ # votr = Volkstrauertag
+ # toso = Totensonntag
+ # adv1 = 1. Advent
+ # adv2 = 2. Advent
+ # adv3 = 3. Advent
+ # adv4 = 4. Advent
# heil = Heiligabend
# wei1 = 1. Weihnachtstag
# wei2 = 2. Weihnachtstag
@@ -192,11 +201,26 @@ sub holidays{
Date::Calc::Add_Delta_Days($year, $month, $day, -47);
$holiday{'fadi'} = _date2timestamp($j_fadi, $m_fadi, $t_fadi);
+ # Ash Wednesday = Easter Sunday minus 46 days
+ my ($j_asmi, $m_asmi, $t_asmi) =
+ Date::Calc::Add_Delta_Days($year, $month, $day, -46);
+ $holiday{'asmi'} = _date2timestamp($j_asmi, $m_asmi, $t_asmi);
+
+ # Maundy Thursday = Easter Sunday minus 3 days
+ my ($j_grdo, $m_grdo, $t_grdo) =
+ Date::Calc::Add_Delta_Days($year, $month, $day, -3);
+ $holiday{'grdo'} = _date2timestamp($j_grdo, $m_grdo, $t_grdo);
+
# Good Friday = Easter Sunday minus 2 days
my ($j_karf, $m_karf, $t_karf) =
Date::Calc::Add_Delta_Days($year, $month, $day, -2);
$holiday{'karf'} = _date2timestamp($j_karf, $m_karf, $t_karf);
+ # Holy Saturday = Easter Sunday minus 1 day
+ my ($j_kars, $m_kars, $t_kars) =
+ Date::Calc::Add_Delta_Days($year, $month, $day, -1);
+ $holiday{'kars'} = _date2timestamp($j_kars, $m_kars, $t_kars);
+
# Easter Sunday is just that
$holiday{'osts'} = _date2timestamp($year, $month, $day);
@@ -241,6 +265,14 @@ sub holidays{
Date::Calc::Add_Delta_Days($year, 12, $tempdate, -32);
$holiday{'buss'} = _date2timestamp($j_buss, $m_buss, $t_buss);
+ # store the sundays in advent and the two sundays before
+ my $sc=0;
+ foreach my $name ("adv4", "adv3", "adv2", "adv1", "toso", "votr") {
+ $holiday{$name} = _date2timestamp(
+ Date::Calc::Add_Delta_Days($year, 12, $tempdate, 7*$sc--)
+ );
+ }
+
# Build list for returning
#
my %holidaylist;
@@ -336,7 +368,10 @@ The module knows about the following holidays:
hl3k Hl. 3 Koenige Epiphany
romo Rosenmontag Carnival monday
fadi Faschingsdienstag Shrove tuesday
+ asmi Aschermittwoch Ash wednesday
+ grdo Gruendonnerstag Maundy Thursday
karf Karfreitag Good friday
+ kars Karsamstag Holy Saturday
osts Ostersonntag Easter sunday
ostm Ostermontag Easter monday
pfis Pfingstsonntag Whit sunday
@@ -351,6 +386,12 @@ The module knows about the following holidays:
refo Reformationstag Reformation day
alhe Allerheiligen All hallows day
buss Buss- und Bettag Penance day
+ votr Volkstrauertag Remembrance Day, German Style
+ toso Totensonntag Sunday in commemoration of the dead
+ adv1 1. Advent 1st sunday in advent
+ adv2 2. Advent 2nd sunday in advent
+ adv3 3. Advent 3rd sunday in advent
+ adv4 4. Advent 4th sunday in advent
heil Heiligabend Christmas eve
wei1 1. Weihnachtstag Christmas
wei2 2. Weihnachtstag Christmas
@@ -495,6 +536,11 @@ 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 I<github> to
+submit your change:
+
+ http://github.com/mschmitt/Date-Holidays-DE
+
I<Tag der Deutschen Einheit> was moved from June 17th to October 3rd in 1990
and is therefore listed twice when calculating holidays for 1990. This is
not a bug. Awareness for this was introduced in Version 1.1.
View
13 README
@@ -4,8 +4,8 @@ Date::Holidays::DE
This module creates a list of German holidays in a given year.
It knows about special holiday regulations for all of Germany's federal
-states and also about "semi-holidays" that will be treated as holidays on
-request.
+states and also about "semi-holidays" and religious "silent days" that
+will be treated as holidays on request.
Holidays that occur on weekends can be excluded from the generated list.
@@ -23,11 +23,12 @@ To install this module type the following:
make install
-DEVELOPMENT STATUS
+PATCHES
-Mostly untested. It works and it's Good Enough(tm) for the author to
-use it in a small application he wrote for one of his clients.
+Patches are welcome. If you can, please fork the project on github to
+submit your change:
+ http://github.com/mschmitt/Date-Holidays-DE
DEPENDENCIES
@@ -39,7 +40,7 @@ This module requires these other modules and libraries:
COPYRIGHT AND LICENSE
- Copyright (c) 2009, Martin Schmitt <mas at scsy dot de>
+ Copyright (c) 2010, Martin Schmitt <mas at scsy dot de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
View
9 example/feiertage.pl
@@ -12,7 +12,10 @@
'hl3k' => 'Hl. 3 Koenige',
'romo' => 'Rosenmontag',
'fadi' => 'Faschingsdienstag',
+ 'asmi' => 'Aschermittwoch',
+ 'grdo' => 'Gruendonnerstag',
'karf' => 'Karfreitag',
+ 'kars' => 'Karsamstag',
'osts' => 'Ostersonntag',
'ostm' => 'Ostermontag',
'pfis' => 'Pfingstsonntag',
@@ -27,6 +30,12 @@
'refo' => 'Reformationstag',
'alhe' => 'Allerheiligen',
'buss' => 'Buss- und Bettag',
+ 'votr' => 'Volkstrauertag',
+ 'toso' => 'Totensonntag',
+ 'adv1' => '1. Advent',
+ 'adv2' => '2. Advent',
+ 'adv3' => '3. Advent',
+ 'adv4' => '4. Advent',
'heil' => 'Heiligabend',
'wei1' => '1. Weihnachtstag',
'wei2' => '2. Weihnachtstag',

0 comments on commit f07c5f6

Please sign in to comment.