projects
/
tpope-extra.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1b4a78d
)
Refined holiday selection
author
Tim Pope
<code@tpope.net>
Wed, 10 Nov 2004 18:28:33 +0000
(18:28 +0000)
committer
Tim Pope
<code@tpope.net>
Wed, 10 Nov 2004 18:28:33 +0000
(18:28 +0000)
perl/sctweb
patch
|
blob
|
history
diff --git
a/perl/sctweb
b/perl/sctweb
index e9d76b994001765b988cc0baed7c69b90b2d5e8a..63b7cbf4a24ec615d76e006129a36a2701bd2ab4 100755
(executable)
--- a/
perl/sctweb
+++ b/
perl/sctweb
@@
-89,11
+89,18
@@
sub off_for_holidays {
$days[Decode_Day_of_Week($_)] = 1;
}
foreach ($year->search("")) {
$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";
}
return wantarray ? @holidays : "@holidays";
}