Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed Tag der deutschen Einheit for years before 1991.

  • Loading branch information...
commit 71657d21c42c6b5b23af4dd1c55c70d574170252 1 parent af8fb39
@mschmitt authored
View
6 Changes
@@ -15,3 +15,9 @@ v.1.0 Sat May 3 13:28:27 CEST 2008
v.1.0.1 Sat May 3 14:05:56 CEST 2008
- Fixed POD wording.
+
+v.1.1 Thu Aug 27 20:02:32 CEST 2009
+ - Fixed Tag der deutschen Einheit for pre-1990 (June 17 then). This has
+ been my peeve for far too long. ;-)
+ - Compatibility tested: 5.6.1-5.10.1
+ - Reverted example scripts to plain ASCII.
View
28 DE.pm
@@ -14,7 +14,7 @@ require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(holidays);
-our $VERSION = '1.0.2';
+our $VERSION = '1.1';
sub holidays{
my %parameters = (
@@ -42,8 +42,9 @@ sub holidays{
# himm = Himmelfahrtstag
# fron = Fronleichnam
# 1mai = Maifeiertag
+ # 17ju = Tag der deutschen Einheit (>= 1954, <= 1990)
# mari = Mariae Himmelfahrt
- # 3okt = Tag der deutschen Einheit
+ # 3okt = Tag der deutschen Einheit (>= 1990)
# refo = Reformationstag
# alhe = Allerheiligen
# buss = Buss- und Bettag
@@ -78,7 +79,7 @@ sub holidays{
my %holidays;
# Common holidays througout Germany
@{$holidays{'common'}} = qw(neuj karf osts ostm 1mai
- pfis pfim himm 3okt wei1 wei2);
+ pfis pfim himm 17ju 3okt wei1 wei2);
# Now the extra holidays for the federal states.
# As if things weren't bad enough, some holidays are only valid
@@ -153,8 +154,13 @@ sub holidays{
# Assumption day Aug 15
$holiday{'mari'} = _date2timestamp($year, 8, 15);
- # Reunion day Oct 3
- $holiday{'3okt'} = _date2timestamp($year, 10, 3);
+ # Reunion day Jun 17 (1954-1990)
+ $holiday{'17ju'} = _date2timestamp($year, 6, 17)
+ if (($year <= 1990) and ($year >= 1954));
+
+ # Reunion day Oct 3 (since 1990)
+ $holiday{'3okt'} = _date2timestamp($year, 10, 3)
+ if ($year >= 1990);
# Reformation day Oct 31
$holiday{'refo'} = _date2timestamp($year, 10, 31);
@@ -329,8 +335,9 @@ The module knows about the following holidays:
himm Himmelfahrtstag Ascension day
fron Fronleichnam Corpus christi
1mai Maifeiertag Labor day, German style
+ 17ju Tag der deutschen Einheit Reunion day (>= 1954, <= 1990)
mari Mariae Himmelfahrt Assumption day
- 3okt Tag der deutschen Einheit Reunion day
+ 3okt Tag der deutschen Einheit Reunion day (>= 1990)
refo Reformationstag Reformation day
alhe Allerheiligen All hallows day
buss Buss- und Bettag Penance day
@@ -479,6 +486,10 @@ 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.
+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.
+
=head1 OFFICIAL HOLIDAY INFORMATION
The German Federal Ministry of the Interior used to publish a comprehensive
@@ -496,10 +507,7 @@ 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.
-B<Date::Holidays::DE> doesn't know anything about past holiday regulations.
-I<Tag der Deutschen Einheit>, for example, was moved in 1991 from June 17th
-to October 3rd after the reunion of the eastern and western parts of Germany.
-None of the calendar programs the author has looked at, know about June 17th.
+Historic regulations for I<Buss- und Bettag> are still not implemented.
B<Date::Holidays::DE> is not configurable. Holiday changes don't come over
night and a new module release can be rolled out within a single day.
View
34 README
@@ -39,24 +39,16 @@ This module requires these other modules and libraries:
COPYRIGHT AND LICENSE
- Copyright (c) 2003, Martin Schmitt <mas@scsy.de>
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+ Copyright (c) 2009, 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
+ 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.
View
16 example/feiertage.pl
@@ -1,18 +1,15 @@
#!/usr/bin/perl -w
use strict;
use warnings;
-use utf8;
use Date::Holidays::DE qw(holidays);
-binmode STDOUT, ":utf8";
-
# Sample script for Date::Holidays::DE by Martin Schmitt <mas at scsy dot de>
# Assign full names to the internal aliases from Date::Holidays::DE
# See the manpage for a list of all aliases.
my %feiertagsnamen = (
'neuj' => 'Neujahrstag',
- 'hl3k' => 'Hl. 3 Könige',
+ 'hl3k' => 'Hl. 3 Koenige',
'romo' => 'Rosenmontag',
'fadi' => 'Faschingsdienstag',
'karf' => 'Karfreitag',
@@ -23,11 +20,12 @@
'himm' => 'Himmelfahrtstag',
'fron' => 'Fronleichnam',
'1mai' => 'Maifeiertag',
- 'mari' => 'Mariä Himmelfahrt',
+ '17ju' => 'Tag der deutschen Einheit (1954-1990)',
+ 'mari' => 'Mariae Himmelfahrt',
'3okt' => 'Tag der deutschen Einheit',
'refo' => 'Reformationstag',
'alhe' => 'Allerheiligen',
- 'buss' => 'Buß- und Bettag',
+ 'buss' => 'Buss- und Bettag',
'heil' => 'Heiligabend',
'wei1' => '1. Weihnachtstag',
'wei2' => '2. Weihnachtstag',
@@ -45,14 +43,14 @@
YEAR => $naechstes
)};
-print "Feiertage für $naechstes:\n";
-print "-------------------\n";
+print "Feiertage fuer $naechstes:\n";
+print "--------------------\n";
foreach (@feiertage){
# Split name and date
my ($name, $datum) = split /:/;
# Print name from $feiertagsnamen along with the date
- printf ("%-30s: %10s\n", $feiertagsnamen{$name}, $datum);
+ printf ("%-40s: %10s\n", $feiertagsnamen{$name}, $datum);
}
exit 0;
View
9 example/werktage-diff.pl
@@ -1,12 +1,9 @@
#!/usr/bin/perl -w
use strict;
use warnings;
-use utf8;
use Date::Holidays::DE qw(holidays);
use Date::Business;
-binmode STDOUT, ":utf8";
-
# Sample script for integration of Date::Holidays::DE with Date::Business
# Script by Martin Schmitt <mas at scsy dot de>
@@ -26,7 +23,7 @@
my $start1 = new Date::Business(DATE => $startdate);
my $end1 = new Date::Business(DATE => $enddate);
my $diff1 = $end1->diff($start1);
-print "$diff1 Tage (Wochenenden und Feiertage unberücksichtigt)\n";
+print "$diff1 Tage (Wochenenden und Feiertage unberuecksichtigt)\n";
# 2. Excluding weekends (Should be 10 days difference)
#
@@ -34,7 +31,7 @@
my $start2 = new Date::Business(DATE => $startdate);
my $end2 = new Date::Business(DATE => $enddate);
my $diff2 = $end2->diffb($start2);
-print "$diff2 Tage (Wochenenden berücksichtigt, Feiertage unberücksichtigt)\n";
+print "$diff2 Tage (Wochenenden beruecksichtigt, Feiertage unberuecksichtigt)\n";
# 3. Excluding weekends and holidays (Should be 8 days difference)
#
@@ -59,6 +56,6 @@ sub business_holiday{
my $end3 = new Date::Business(DATE => $enddate,
HOLIDAY => \&business_holiday);
my $diff3 = $end3->diffb($start3);
-print "$diff3 Tage (Wochenenden und Feiertage berücksichtigt)\n";
+print "$diff3 Tage (Wochenenden und Feiertage beruecksichtigt)\n";
exit 0;
Please sign in to comment.
Something went wrong with that request. Please try again.