Skip to content

Commit

Permalink
git-svn-id: file:///opt/svn/scripts/misc/perl/cpan/Date-Holidays-DE/t…
Browse files Browse the repository at this point in the history
…runk@74 484cc3a2-7d94-4784-8140-313c9a92d1de
  • Loading branch information
martin committed May 19, 2008
1 parent 13a343c commit 204bdd3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
7 changes: 7 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@ v.0.6 Sun Nov 23 12:37:56 CET 2003
- Option to generate a list of all known holidays
- Added example scripts

v.1.0 Sat May 3 13:28:27 CEST 2008
- %s in format string wasn't robust on some platforms. The availability check
was removed and everything dumbed down as kindly suggested by one user.
- Used the opportunity for making this a major release.

v.1.0.1 Sat May 3 14:05:56 CEST 2008
- Fixed POD wording.
14 changes: 5 additions & 9 deletions DE.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package Date::Holidays::DE;
# $Id$

use strict;
use warnings;
Expand All @@ -14,7 +15,7 @@ require Exporter;

our @ISA = qw(Exporter);
our @EXPORT_OK = qw(holidays);
our $VERSION = '0.6';
our $VERSION = '1.0.1';

sub holidays{
my %parameters = (
Expand Down Expand Up @@ -275,12 +276,10 @@ sub holidays{
#
my @returnlist;
foreach(sort{$holidaylist{$a}<=>$holidaylist{$b}}(keys(%holidaylist))){
# See if this platform has strftime(%s)
# if not, inject seconds manually into format string.
# Not all platforms have strftime(%s).
# Therefore, inject seconds manually into format string.
my $formatstring = $parameters{'FORMAT'};
if (strftime('%s', localtime($holidaylist{$_})) eq '%s'){
$formatstring =~ s/%{0}%s/$holidaylist{$_}/g;
}
$formatstring =~ s/%{0}%s/$holidaylist{$_}/g;
# Inject the holiday's alias name into the format string
# if it was requested by adding %#.
$formatstring =~ s/%{0}%#/$_/;
Expand Down Expand Up @@ -504,9 +503,6 @@ None of the calendar programs the author has looked at, know about June 17th.
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.
B<Date::Holidays::DE> probably won't work in Microsoft's "Windows" operating
environment.
=head1 AUTHOR
Martin Schmitt E<lt>mas at scsy dot deE<gt>
Expand Down
2 changes: 1 addition & 1 deletion example/feiertage.pl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

# Get the list of holidays for next year
my @feiertage = @{holidays( WHERE => ['all'],
FORMAT => "%#:%d.%m.%Y",
FORMAT => "%#:%d.%m.%Y (%s s since the epoch.)",
YEAR => $naechstes
)};

Expand Down

0 comments on commit 204bdd3

Please sign in to comment.