line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Spreadsheet::Engine::Function::WEEKDAY; |
2
|
|
|
|
|
|
|
|
3
|
28
|
|
|
28
|
|
156
|
use strict; |
|
28
|
|
|
|
|
66
|
|
|
28
|
|
|
|
|
999
|
|
4
|
28
|
|
|
28
|
|
143
|
use warnings; |
|
28
|
|
|
|
|
62
|
|
|
28
|
|
|
|
|
741
|
|
5
|
|
|
|
|
|
|
|
6
|
28
|
|
|
28
|
|
156
|
use base 'Spreadsheet::Engine::Fn::math'; |
|
28
|
|
|
|
|
76
|
|
|
28
|
|
|
|
|
5468
|
|
7
|
|
|
|
|
|
|
|
8
|
72
|
|
|
72
|
1
|
245
|
sub argument_count { -1 => 2 } |
9
|
70
|
|
|
70
|
1
|
332
|
sub signature { 'n', [ '>=1', '<=3' ] } |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub calculate { |
12
|
70
|
|
|
70
|
1
|
2467
|
my ($self, $date, $type) = @_; |
13
|
70
|
|
100
|
|
|
274
|
$type ||= 1; |
14
|
|
|
|
|
|
|
|
15
|
70
|
|
|
|
|
125
|
my $doffset = 6; |
16
|
70
|
100
|
|
|
|
202
|
$doffset-- if $type > 1; |
17
|
70
|
100
|
|
|
|
1798
|
return int($date + $doffset) % 7 + ($type < 3 ? 1 : 0); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
1; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
__END__ |