line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Date::Holidays::NO; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
23071
|
use vars qw($VERSION); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
138
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
$VERSION=0.2; |
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
12
|
use base qw(Date::Holidays::Abstract); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
5611
|
|
8
|
2
|
|
|
2
|
|
25456
|
use No::Dato qw(helligdag helligdager); |
|
2
|
|
|
|
|
14634
|
|
|
2
|
|
|
|
|
2116
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub holidays { |
11
|
1
|
|
|
1
|
1
|
3
|
my $year=shift; |
12
|
1
|
|
|
|
|
5
|
my @days=helligdager($year); |
13
|
1
|
|
|
|
|
41
|
my %days; |
14
|
1
|
|
|
|
|
2
|
foreach my $day (@days) { |
15
|
12
|
|
|
|
|
87
|
my ($month,$day, $text)=$day=~m/\d{4}-(\d{2})-(\d{2})\s*(.*)$/; |
16
|
12
|
|
|
|
|
35
|
$days{"$month$day"}=$text |
17
|
|
|
|
|
|
|
} |
18
|
1
|
|
|
|
|
7
|
return \%days; |
19
|
|
|
|
|
|
|
}; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub is_holiday { |
22
|
1
|
|
|
1
|
1
|
1239
|
my ($year,$month,$day)=@_; |
23
|
1
|
50
|
|
|
|
5
|
$month=($month<10 ?"0".$month : $month); |
24
|
1
|
50
|
|
|
|
5
|
$day=($day<10 ?"0".$day :$day); |
25
|
1
|
|
|
|
|
8
|
my $holiday=helligdag("$year-$month-$day"); |
26
|
1
|
50
|
|
|
|
329
|
return $holiday if $holiday; |
27
|
0
|
|
|
|
|
|
return undef; |
28
|
|
|
|
|
|
|
}; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__END__ |