From: Tim Pope Date: Wed, 10 Nov 2004 18:28:33 +0000 (+0000) Subject: Refined holiday selection X-Git-Url: http://git.tpope.net/?p=tpope-extra.git;a=commitdiff_plain;h=401a7070c1f68d5f5f105b5a31643b4ed98e6e88 Refined holiday selection --- diff --git a/perl/sctweb b/perl/sctweb index e9d76b9..63b7cbf 100755 --- a/perl/sctweb +++ b/perl/sctweb @@ -89,11 +89,18 @@ sub off_for_holidays { $days[Decode_Day_of_Week($_)] = 1; } foreach ($year->search("")) { - next unless ($year->is_full($_) && $_>=$firstday && $_<=$lastday); - if (defined($days[Day_of_Week($_->date)])) { - push @holidays, $_; + my $good=1; + foreach my $x ($year->labels($_)) { + $good=0 if $x =~ /Veteran/; + $good=2 if $x =~ /Thanksgiving/; } + next unless ($year->is_full($_) && $_>=$firstday && $_<=$lastday); + push @holidays, $_ + if (defined($days[Day_of_Week($_->date)]) && $good); + push @holidays, $_+1 + if (defined($days[5]) && $good==2); } + print "@holidays\n"; return wantarray ? @holidays : "@holidays"; }