Branch Coverage

lib/Date/Manip/Date.pm
Criterion Covered Total %
branch 1132 1490 75.9


line true false branch
102 0 4106 unless ($instring)
135 8 4231 if ($self->_parse_rule("remove_trailing_period"))
143 42 4197 if ($self->_parse_rule("remove_parens"))
149 42 4197 if ($words)
160 1922 2317 if (defined $tmp)
168 2312 5 unless (exists $opts{'noiso8601'})
170 314 1998 if ($done)
186 2003 0 unless (exists $opts{'nospecial'})
188 24 1979 if ($done)
198 1108 871 if ($got_time)
202 10 1969 unless ($string)
210 1969 0 unless (exists $opts{'nodow'})
212 597 1372 if (@tmp)
213 12 585 if ($done) { }
222 1372 585 unless $dow
239 1663 294 if (@tmp)
242 0 538 if ($dow2 and $dow and $dow != $dow2)
246 538 1125 if $dow2
253 281 13 unless ($tzstring)
255 9 272 if @tmp
256 0 281 unless $string
261 22 272 if ($tzstring)
263 1 21 if (@tmp)
288 185 108 unless (exists $opts{'nodelta'})
292 30 155 if (@tmp)
297 36 149 if $done
305 0 149 if (@tmp)
311 0 149 if $done
316 257 0 unless (exists $opts{'noholidays'})
319 9 248 if (@tmp)
322 9 248 if $done
334 254 3985 if ($self->{'err'})
335 129 125 unless ($firsterr)
346 121 3985 if ($self->{'err'})
353 611 3374 unless ($got_time)
354 606 5 if ($default_time) { }
355 8 598 if (exists $self->{'data'}{'default_time'}) { }
582 16 elsif ($dmb->_config('defaulttime') eq 'midnight') { }
380 0 30 unless ($string)
387 0 30 if ($self->{'err'})
390 0 30 if ($self->{'data'}{'set'}) { }
402 5 25 if $self->{'err'}
414 0 1012 unless ($string)
423 2 1010 if ($self->{'err'})
426 7 1005 if ($self->{'data'}{'set'}) { }
439 1012 0 unless (exists $opts{'noiso8601'})
441 70 942 if ($done)
448 818 124 if (@tmp)
457 0 888 if $self->{'err'}
478 2848 73 exists $dmb->{'data'}{'rx'}{'other'}{'ignore'} ? :
484 0 2921 unless $string
495 2921 0 unless (exists $opts{'nodow'})
496 942 1979 unless (defined $dow)
498 664 278 if (@tmp)
499 6 658 if ($done) { }
506 278 658 unless $dow
512 2915 0 unless (exists $opts{'nocommon'})
514 1586 1329 if (@tmp)
522 1329 0 unless (exists $opts{'noother'})
524 874 455 if (@tmp)
532 420 10 unless ($dow or $of)
534 16 404 if (@tmp)
551 0 7 unless ($string)
560 0 7 if $err
561 0 7 unless $string =~ /$re/
576 0 7 if (defined $epochs)
579 0 0 if ($zone) { }
0 0 elsif ($abb or $off) { }
581 0 0 unless $z
585 0 0 unless ($z)
588 0 0 unless $z
598 0 7 if (defined $epocho)
609 0 7 if ($mon_name) { }
2 5 elsif ($mon_abb) { }
615 0 7 if ($nth)
619 0 7 if ($doy) { }
0 7 elsif ($g) { }
0 7 elsif ($l) { }
5 2 elsif ($m) { }
620 0 0 unless $y
625 0 0 unless $y
634 0 0 unless $y
649 4 3 if (defined $h)
653 2 5 if ($ampm)
654 0 2 if ($dmb->{'data'}{'wordmatch'}{'ampm'}{lc $ampm} == 2) { }
656 0 0 unless $h == 12
659 2 0 if $h == 12
666 0 7 if ($dow_name) { }
0 7 elsif ($dow_abb) { }
0 7 elsif ($dow_char) { }
677 2 5 unless ($m)
681 3 4 unless (defined $h)
690 1 6 if (wantarray)
716 0 7 if (exists $dmb->{'data'}{'format'}{$format})
726 0 65 if $format eq "%"
728 30 35 if ($format =~ s/^([^%]+)//)
736 5 30 if (exists $y_form{$f})
737 0 5 if ($y)
744 5 30 if (exists $m_form{$f})
745 0 5 if ($m)
752 5 30 if (exists $d_form{$f})
753 0 5 if ($d)
760 4 31 if (exists $h_form{$f})
761 0 4 if ($h)
768 4 31 if (exists $mn_form{$f})
769 0 4 if ($mn)
776 4 31 if (exists $s_form{$f})
777 0 4 if ($s)
784 0 35 if (exists $dow_form{$f})
785 0 0 if ($dow)
792 2 33 if (exists $am_form{$f})
793 0 2 if ($ampm)
800 2 33 if (exists $z_form{$f})
801 0 2 if ($zone)
808 0 35 if ($f eq 'G') { }
0 35 elsif ($f eq 'W') { }
0 35 elsif ($f eq 'L') { }
0 35 elsif ($f eq 'U') { }
809 0 0 if ($G)
816 0 0 if ($W)
823 0 0 if ($L)
830 0 0 if ($U)
839 5 30 if ($f eq 'Y') { }
0 30 elsif ($f eq 'y') { }
3 27 elsif ($f eq 'm') { }
0 27 elsif ($f eq 'f') { }
2 25 elsif (exists $mon_form{$f}) { }
0 25 elsif ($f eq 'j') { }
5 20 elsif ($f eq 'd') { }
0 20 elsif ($f eq 'e') { }
0 20 elsif (exists $day_form{$f}) { }
0 20 elsif ($f eq 'w') { }
0 20 elsif ($f eq 'E') { }
4 16 elsif ($f eq 'H' or $f eq 'I') { }
0 16 elsif ($f eq 'k' or $f eq 'i') { }
2 14 elsif ($f eq 'p') { }
4 10 elsif ($f eq 'M') { }
4 6 elsif ($f eq 'S') { }
2 4 elsif (exists $z_form{$f}) { }
0 4 elsif ($f eq 's') { }
0 4 elsif ($f eq 'o') { }
0 4 elsif ($f eq 'G') { }
0 4 elsif ($f eq 'W') { }
0 4 elsif ($f eq 'L') { }
0 4 elsif ($f eq 'U') { }
0 4 elsif ($f eq 'c') { }
0 4 elsif ($f eq 'C' or $f eq 'u') { }
0 4 elsif ($f eq 'g') { }
0 4 elsif ($f eq 'D') { }
2 2 elsif ($f eq 'r') { }
0 2 elsif ($f eq 'R') { }
2 0 elsif ($f eq 'T' or $f eq 'X') { }
0 0 elsif ($f eq 'V') { }
0 0 elsif ($f eq 'Q') { }
0 0 elsif ($f eq 'q') { }
0 0 elsif ($f eq 'P') { }
0 0 elsif ($f eq 'O') { }
0 0 elsif ($f eq 'F') { }
0 0 elsif ($f eq 'K') { }
0 0 elsif ($f eq 'J') { }
0 0 elsif ($f eq 'x') { }
0 0 elsif ($f eq 't') { }
0 0 elsif ($f eq '%') { }
0 0 elsif ($f eq '+') { }
961 0 0 if ($dmb->_config('dateformat') eq 'US') { }
978 0 7 if ($m != $d) { }
0 7 elsif ($h || $mn || $s and not $h && $mn) { }
0 7 elsif ($ampm and not $h) { }
0 7 elsif ($G != $W) { }
0 7 elsif ($L != $U) { }
990 0 7 if ($err)
1008 92 12625 if (exists $dmb->{'data'}{'lang'}{'_special_rules'} and exists $dmb->{'data'}{'lang'}{'_special_rules'}{$rule})
1028 1105 3800 if ($dow)
1030 4 1101 if ($tmp != $dow)
1038 5 4896 if ($h == 24)
1043 8 4893 unless ($dmb->check([$y, $m, $d, $h, $mn, $s]))
1057 104 4789 defined $abb ? :
1058 52 4841 defined $off ? :
1061 8 4885 if (defined $zone) { }
143 4742 elsif (defined $abb or defined $off) { }
1063 8 0 if ($zonename)
1070 136 7 if ($zonename)
1074 4 139 if (not @tmp and defined $abb)
1076 0 4 if ($tmp)
1084 4742 0 if ($zonename)
1089 7 4886 unless ($zonename)
1090 0 7 if (defined $zone) { }
1098 1 4885 unless (@tmp)
1108 0 4885 if $self->{'err'}
1111 8 4877 if defined $zone
1121 49 4837 if (defined $off)
1127 2 4888 unless $per
1132 2 4886 if defined $abb and lc $a ne lc $abb
1135 50 4836 if (defined $off)
1136 0 49 if $off->[0] != $o->[0] or $off->[1] != $o->[1] or $off->[2] != $o->[2]
1167 3418 271 if exists $dmb->{'data'}{'rx'}{'iso'}{$rx}
1169 88 183 if ($rx eq 'cdate' or $rx eq 'tdate') { }
77 106 elsif ($rx eq 'ctime' or $rx eq 'ttime') { }
29 77 elsif ($rx eq 'date') { }
1 76 elsif ($rx eq 'time') { }
76 0 elsif ($rx eq 'fulldate') { }
1331 314 1998 if ($string =~ /$daterx/) { }
1336 39 275 if (defined $w or defined $dow) { }
16 259 elsif (defined $doy) { }
1341 0 259 if defined $c
1362 70 942 if ($string =~ /^$daterx$/) { }
1366 30 40 if (defined $w or defined $dow) { }
7 33 elsif (defined $doy) { }
1371 0 33 if defined $c
1387 76 1371 if (defined $ampm and $ampm)
1390 70 6 if ($dmb->{'data'}{'wordmatch'}{'ampm'}{lc $ampm} == 2) { }
1392 70 0 unless $h == 12
1395 1 5 if $h == 12
1399 4 1443 if (defined $h24) { }
12 1431 elsif (defined $fh and $fh ne '') { }
8 2846 elsif (defined $fm and $fm ne '') { }
1422 0 500 unless defined $rx
1424 62 438 if ($rx eq 'time') { }
73 365 elsif ($rx eq 'common_1') { }
73 292 elsif ($rx eq 'common_2') { }
35 257 elsif ($rx eq 'truncated') { }
73 184 elsif ($rx eq 'dow') { }
73 111 elsif ($rx eq 'ignore') { }
65 46 elsif ($rx eq 'miscdatetime') { }
46 0 elsif ($rx eq 'misc') { }
1434 3 59 if (exists $dmb->{'data'}{'rx'}{'sepfr'} and $dmb->{'data'}{'rx'}{'sepfr'}) { }
1441 3 59 if ($sepfr) { }
1455 62 0 if (exists $dmb->{'data'}{'rx'}{'ampm'})
1463 1 61 if ($dmb->_config("periodtimesep"))
1467 8 0 if (exists $dmb->{'data'}{'rx'}{'sephm'} and defined $dmb->{'data'}{'rx'}{'sephm'} and exists $dmb->{'data'}{'rx'}{'sepms'} and defined $dmb->{'data'}{'rx'}{'sepms'})
1483 72 0 if $ampm
1495 72 0 if $ampm
1505 72 0 if $ampm
1514 62 0 if $ampm
1573 69 4 unless $format_mmmyyyy
1620 4 31 if $format_mmmyyyy
1628 4 31 if (@daterx) { }
1772 30 1979 if ($caller eq "parse_time")
1774 29 1 exists $dmb->{'data'}{'rx'}{'iso'}{'time'} ? :
1777 30 0 unless (exists $opts{'noiso8601'})
1778 14 16 if ($string =~ s/^\s*$timerx\s*$//)
1783 0 0 if $h == 24 and $mn == 0 and $s == 0
1792 1995 0 unless ($got_time or exists $opts{'noother'})
1797 179 3900 if ($string =~ /$rx/)
1806 1995 14 unless ($got_time)
1808 1933 62 exists $dmb->{'data'}{'rx'}{'other'}{'time'} ? :
1811 1124 871 if ($string =~ s/$timerx/ /)
1816 1 0 if $h == 24 and $mn == 0 and $s == 0
1825 1979 30 if ($caller eq "parse")
1826 1108 871 if ($got_time) { }
1836 5 25 if (not $got_time or $string)
1858 2842 73 exists $dmb->{'data'}{'rx'}{'other'}{'common_1'} ? :
1861 228 2687 if ($string =~ /$daterx/)
1864 20 208 if ($dmb->_config("dateformat") ne "US")
1873 2614 73 exists $dmb->{'data'}{'rx'}{'other'}{'common_2'} ? :
1876 1358 1329 if ($string =~ /$daterx/)
1879 1237 121 if ($mmm) { }
115 6 elsif ($month) { }
1899 385 35 exists $dmb->{'data'}{'rx'}{'other'}{'truncated'} ? :
1902 404 16 unless $daterx
1910 16 0 if ($string =~ /$daterx/)
1914 16 0 if ($mmm) { }
0 0 elsif ($month) { }
1922 16 0 if ($y and $m)
1925 8 8 if ($format_mmmyyyy eq 'first') { }
1949 9 272 if ($string =~ s/(?:^|\s)$rx(?:$|\s)/ /)
1965 2838 73 exists $dmb->{'data'}{'rx'}{'other'}{'dow'} ? :
1967 1261 1650 if ($string =~ s/$rx/ /) { }
1972 567 694 if exists $dmb->{'data'}{'wordmatch'}{'day_abb'}{$dow}
1974 694 567 if exists $dmb->{'data'}{'wordmatch'}{'day_name'}{$dow}
1982 1243 18 if $string
1993 0 18 if $dow1 > $dow
2005 150 107 unless (exists $dmb->{'data'}{'rx'}{'holidays'})
2013 9 98 if ($string =~ /$rx/)
2016 5 4 unless $y
2022 0 9 unless exists $dmb->{'data'}{'holidays'}{'yhols'}{$y + 0}{$hol}
2042 36 298 unless ($err)
2046 0 36 if (abs $dy > 10000 or abs $dm > 120000 or abs $dw > 530000 or abs $dd > 3660000 or abs $dh > 87840000 or abs $dmn > 5270400000 or abs $ds > '316224000000')
2057 4 6 if ($got_time and $dh != 0 || $dmn != 0 || $ds != 0)
2063 6 24 if ($got_time) { }
2070 0 30 $delta->{'data'}{'mode'} eq 'business' ? :
2079 10 20 if ($dow)
2080 0 10 if ($dd != 0 or $dh != 0 or $dmn != 0 or $ds != 0)
2090 0 10 if $dow1 > $dow
2107 1938 65 exists $dmb->{'data'}{'rx'}{'other'}{'miscdatetime'} ? :
2110 24 1979 if ($string =~ /$rx/)
2114 18 6 if (defined $special) { }
5 1 elsif (defined $epoch) { }
1 0 elsif (defined $y) { }
2126 1 17 if ($tzstring)
2128 0 1 unless defined $date2
2129 0 1 defined $off ? :
2130 0 1 defined $zone ? :
2131 1 0 defined $abb ? :
2135 0 0 if (not $tmp and $abbrev and not $zone)
2137 0 0 if $abbrev
2141 0 1 unless $zone
2156 1 4 if ($tzstring) { }
2158 0 1 defined $off ? :
2159 0 1 defined $zone ? :
2160 1 0 defined $abb ? :
2164 0 0 if (not $tmp and $abbrev and not $zone)
2166 0 0 if $abbrev
2170 0 1 unless $zone
2194 1283 46 exists $dmb->{'data'}{'rx'}{'other'}{'misc'} ? :
2200 879 450 if ($string =~ /$rx/) { }
2206 90 789 if (defined $y) { }
2209 0 90 unless $y
2217 698 181 if (defined $mmm) { }
31 150 elsif ($month) { }
2225 632 247 if ($nth)
2229 32 847 if ($got_m and $nth and not $dow) { }
50 797 elsif ($nextprev) { }
127 670 elsif ($last) { }
584 86 elsif ($nth and $dow and not $field_w) { }
25 61 elsif ($field_w and $dow) { }
5 56 elsif ($nth and not $got_y) { }
56 0 elsif ($special) { }
2241 22 28 if ($dmb->{'data'}{'wordmatch'}{'nextprev'}{lc $nextprev} == 1)
2246 28 22 if ($field_y or $field_m or $field_w) { }
22 0 elsif ($dow) { }
2250 8 20 if ($field_y) { }
10 10 elsif ($field_m) { }
2282 6 121 if ($field_d and $got_m) { }
120 1 elsif ($dow and $got_m) { }
1 0 elsif ($dow) { }
2307 571 13 if ($got_m) { }
2308 569 2 if ($of) { }
2310 2 567 if $nth > 5
2316 454 113 if $nth > 1
2318 0 567 if not $m2 or $m2 != $m
2329 9 4 if $nth > 1
2335 23 2 if (defined $n or $nth) { }
2339 11 12 if $nth
2340 2 21 unless $n
2357 0 4 if $field_d or $field_w or $field_m or $field_y
2375 8 48 if ($field_w)
2390 324 1593 unless defined $y
2391 65 1852 unless defined $m
2392 69 1848 unless defined $d
2401 324 1593 if ($y eq '') { }
2415 1852 65 if ($m ne '') { }
4 61 elsif ($defined) { }
2431 1848 69 if ($d ne '') { }
13 56 elsif ($defined) { }
2448 2 21 unless defined $y
2456 2 21 if ($y eq '') { }
2475 20 49 unless defined $y
2476 8 61 unless defined $w
2477 18 51 unless defined $dow
2488 49 20 if ($y ne '') { }
2489 0 49 if (length $y == 1) { }
2510 61 8 if ($w ne '') { }
2522 18 51 if ($dow eq "")
2527 5 64 if ($d > $n)
2529 0 5 if ($m == 13)
2542 126 2464 unless defined $h
2543 143 2447 unless defined $m
2544 413 2177 unless defined $s
2551 126 0 if ($h eq "" and $m eq "" and $s eq "")
2562 2464 0 if ($h ne '') { }
2575 2447 17 if ($m ne '') { }
17 0 elsif ($defined) { }
2589 287 2177 if ($s eq "")
2614 15 32651 unless ($self->{'data'}{'set'})
2619 29444 3207 unless $type
2621 2988 29663 if ($type eq 'gmt') { }
219 29444 elsif ($type eq 'local') { }
2623 2686 302 unless (@{$self->{'data'}{'gmt'};})
2627 0 2686 if ($zone eq 'Etc/GMT') { }
2633 0 2686 if ($err)
2644 219 0 unless (@{$self->{'data'}{'loc'};})
2649 192 27 if ($zone eq $local) { }
2655 0 27 if ($err)
2673 18 32648 if ($self->{'err'})
2674 18 0 if (wantarray) { }
2681 7934 24714 if (wantarray) { }
2690 0 10659 if ($self->{'err'} or not $self->{'data'}{'set'})
2695 0 10659 unless (ref $date eq "Date::Manip::Date")
2699 0 10659 if ($date->{'err'} or not $date->{'data'}{'set'})
2705 10658 1 if ($self->{'data'}{'tz'} eq $date->{'data'}{'tz'}) { }
2731 4889 5635 if ($field eq 'zdate') { }
5569 66 elsif ($field eq 'date') { }
2738 4 4885 if $self->{'data'}{'set'} != 2
2742 319 5250 if ($self->{'data'}{'set'} and not $self->{'err'}) { }
2751 0 66 if $self->{'err'} or not $self->{'data'}{'set'}
2763 5569 4955 if ($field eq 'date') { }
64 4891 elsif ($field eq 'time') { }
4889 2 elsif ($field eq 'zdate') { }
0 2 elsif ($field eq 'zone') { }
2 0 elsif (exists $field{$field}) { }
2765 5554 15 if ($#val == 0) { }
15 0 elsif ($#val == 1) { }
2775 0 33414 if $def[$i]
2780 64 0 if ($#val == 0) { }
0 0 elsif ($#val == 1) { }
2789 0 64 if $def[3]
2790 0 64 if $def[4]
2791 1 63 if $def[5]
2795 2 4887 if ($#val == 0) { }
0 4887 elsif ($#val == 1 and $val[1] eq '0' || $val[1] eq '1') { }
2 4885 elsif ($#val == 1) { }
4885 0 elsif ($#val == 2) { }
2810 4 4885 if ($self->{'data'}{'set'} != 2)
2812 0 24 if $def[$i]
2815 2 4887 unless $new_tz
2819 0 0 if ($#val == -1) { }
0 0 elsif ($#val == 0 and $val[0] eq '0' || $val[0] eq '1') { }
0 0 elsif ($#val == 0) { }
0 0 elsif ($#val == 1) { }
2833 0 0 unless $new_tz
2839 2 0 if ($#val == 0) { }
0 0 elsif ($#val == 1) { }
2848 0 2 if $def[$i]
2856 0 10524 if ($err)
2857 0 0 if ($err == 1) { }
2867 4887 5637 if ($new_tz)
2869 4887 0 if ($tmp) { }
2877 0 0 $isdst ? :
0 0 if defined $isdst
2881 0 0 unless ($tz)
2888 10458 66 if ($new_date)
2889 10454 4 if ($dmb->check($new_date)) { }
2897 64 10456 if ($new_time)
2898 64 0 if ($dmb->check_time($new_time)) { }
2911 42 10478 if ($tz eq 'etc/gmt') { }
2917 3 10475 unless ($per)
2945 0 75 if $self->{'err'} or not $self->{'data'}{'set'}
2950 0 75 unless defined $date
2957 0 75 if $self->{'err'} or not $self->{'data'}{'set'}
2962 0 75 unless defined $date
2971 944 254 if ($next) { }
2987 366 832 if (defined $time)
2988 34 332 if ($dow) { }
2991 0 34 if ($err)
2999 0 332 if ($#tmp != 2)
3004 296 36 if (defined $h) { }
24 12 elsif (defined $mn) { }
3005 14 282 unless defined $mn
3006 3 293 unless defined $s
3008 0 24 unless defined $s
3010 0 12 unless defined $s
3018 866 332 if ($dow)
3020 0 866 unless ($dmb->_is_int($dow, 1, 7))
3030 182 684 if ($dow == $curr_dow) { }
3031 62 120 if $curr == 0
3035 559 125 if ($next) { }
3037 454 105 if $dow < $curr_dow
3041 20 105 if $dow > $curr_dow
3050 34 832 if (defined $time)
3057 8 858 if $curr == 2 and $cmp != -1 * $sign
3059 70 796 if ($adjust)
3069 332 0 if (defined $time)
3075 296 36 if (defined $h) { }
24 12 elsif (defined $mn) { }
3080 109 187 if ($cmp == -1) { }
69 118 elsif ($cmp == 1) { }
3081 10 99 if ($prev)
3085 69 0 if ($next)
3089 102 16 unless ($curr)
3100 0 24 if ($cmp == -1) { }
8 16 elsif ($cmp == 1) { }
3101 0 0 if ($prev)
3105 4 4 if ($next)
3109 8 8 unless ($curr)
3120 0 12 if ($cmp == -1) { }
0 12 elsif ($cmp == 1) { }
3121 0 0 if ($prev)
3125 0 0 if ($next)
3129 8 4 unless ($curr)
3148 1430 3178 if (ref $obj eq 'Date::Manip::Date') { }
3178 0 elsif (ref $obj eq 'Date::Manip::Delta') { }
3163 0 1430 if ($self->{'err'} or not $self->{'data'}{'set'})
3168 0 1430 if ($date->{'err'} or not $date->{'data'}{'set'})
3177 1155 275 if ($#args == -1) { }
226 49 elsif ($#args == 0) { }
49 0 elsif ($#args == 1) { }
3180 0 226 if ($args[0] eq '0' or $args[0] eq '1') { }
3192 1155 275 unless $mode
3194 0 1430 unless ($mode =~ /^(business|bsemi|bapprox|approx|semi|exact)$/i)
3211 156 1274 if ($mode eq 'business' or $mode eq 'bapprox' or $mode eq 'bsemi') { }
86 1188 elsif ($mode eq 'approx' || $mode eq 'semi' and $self->{'data'}{'tz'} eq $date->{'data'}{'tz'}) { }
3212 156 0 if ($self->{'data'}{'tz'} eq $date->{'data'}{'tz'}) { }
3246 42 1388 if ($subtract) { }
3247 23 19 if ($mode eq 'business' or $mode eq 'exact' or $subtract == 2) { }
3262 156 1274 if ($mode eq 'business' or $mode eq 'bapprox' or $mode eq 'bsemi') { }
3277 112 1318 if ($mode eq "approx" or $mode eq "bapprox")
3283 90 22 if ($dy or $dm)
3290 6 84 if $d1 > $dim
3296 88 1342 if ($mode eq "semi" or $mode eq "approx")
3310 69 19 if ($dw or $dd)
3315 25 7 if ($dy or $dm or $dw or $dd)
3316 39 42 $dw > 0 || $dd > 0 ? :
3323 94 1336 if ($mode eq "bsemi" or $mode eq "bapprox")
3335 88 156 if ($mode eq "exact" or $mode eq "semi" or $mode eq "approx")
3349 94 1274 if ($mode eq "business" or $mode eq "bsemi" or $mode eq "bapprox")
3362 2 154 if ($y1 < $y2) { }
3 151 elsif ($y1 > $y2) { }
2 149 elsif ($m1 < $m2) { }
3 146 elsif ($m1 > $m2) { }
73 73 elsif ($d1 < $d2) { }
33 40 elsif ($d1 > $d2) { }
3381 297 159 if $self->__is_business_day([$y1, $m1, $d1, 0, 0, 0], 0)
3382 116 323 if $y1 == $y2 and $m1 == $m2 and $d1 == $d2
3401 0 3178 if ($self->{'err'} or not $self->{'data'}{'set'})
3406 0 3178 if ($delta->{'err'})
3413 1942 1236 unless $subtract
3416 75 3103 $delta->{'data'}{'mode'} eq 'business' ? :
3422 0 3176 if (abs $dy > 10000 or abs $dm > 120000 or abs $dw > 530000 or abs $dd > 3660000 or abs $dh > 87840000 or abs $dmn > 5270400000 or abs $ds > '316224000000')
3437 1 3175 if (ref $date2 eq 'ARRAY' and $date2->[0] < 0 || $date2->[0] > 9999) { }
2 3173 elsif ($err) { }
3469 75 3233 if ($business) { }
3473 2 73 if ($subtract == 2 and not $self->__is_business_day($date, 1))
3482 1198 2108 if ($subtract == 2 and $dy || $dm || $dw || $dd_approx) { }
3503 1198 0 unless $err
3514 36 2072 if $subtract
3518 1867 241 if ($dy or $dm or $dw or $dd) { }
48 193 elsif ($business) { }
3526 54 1840 if not $err and $dd_exact || $dh || $dmn || $ds
3577 0 1198 if ($business) { }
3591 0 0 if ($cmp < 0) { }
0 0 elsif ($cmp > 0) { }
3597 0 0 if ($cmp < 0) { }
0 0 elsif ($cmp > 0) { }
3612 0 0 if ($cmp > 0) { }
0 0 elsif ($cmp < 0) { }
3634 8 1190 if ($cmp < 0) { }
2 1188 elsif ($cmp > 0) { }
3639 1 8 if ($cmp < 0) { }
0 8 elsif ($cmp > 0) { }
3653 0 2 if ($cmp > 0) { }
0 2 elsif ($cmp < 0) { }
3672 0 1198 unless defined $date2
3700 1411 456 if $dy
3701 384 1483 if $dm
3705 1 1866 if $d > $dim
3716 25 1842 if ($business) { }
3717 5 20 if $dw
3728 267 1600 if ($dd)
3744 1784 83 $dd > 0 || $dw > 0 || $dm > 0 || $dy > 0 ? :
3758 68 1398 if ($business) { }
3781 20 48 if ($dd)
3783 4 16 if ($dd < 1)
3805 20 48 if ($h > $hend or $h == $hend and $mn > $mend or $h == $hend and $mn == $mend and $s > $send or $h == $hend and $mn == $mend and $s == $send) { }
15 33 elsif ($h < $hbeg or $h == $hbeg and $mn < $mbeg or $h == $hbeg and $mn == $mbeg and $s < $sbeg) { }
3816 20 6 if $self->__is_business_day([$y, $m, $d, $h, $mn, $s])
3831 15 2 if $self->__is_business_day([$y, $m, $d, $h, $mn, $s])
3839 51 17 $dd > 0 || $dh > 0 || $dmn > 0 || $ds > 0 ? :
3859 1 1397 if $date->[0] < 0 or $date->[0] > 9999
3895 3214 0 if ($per)
3902 0 0 if ($per)
3914 0 0 unless ($force)
3919 0 0 if ($force > 0) { }
3928 0 0 unless $per
3949 3 5 if (defined $secs)
3953 0 3 if $err
3958 0 5 if ($self->{'err'} or not $self->{'data'}{'set'})
3970 0 27 if ($self->{'err'} or not $self->{'data'}{'set'})
3985 3 24 if $yy > $y
3986 2 22 if $yy < $y
3992 0 7 if ($self->{'err'} or not $self->{'data'}{'set'})
3997 4 3 unless ($field)
4002 1 1 unless $self->{'data'}{'def'}[1] or $self->{'data'}{'def'}[2] or $self->{'data'}{'def'}[3] or $self->{'data'}{'def'}[4] or $self->{'data'}{'def'}[5]
4006 1 2 if ($field eq "m")
4007 1 0 unless $self->{'data'}{'def'}[1]
4010 0 2 if ($field eq "d")
4011 0 0 unless $self->{'data'}{'def'}[2]
4014 1 1 if ($field eq "h")
4015 1 0 unless $self->{'data'}{'def'}[3]
4018 0 1 if ($field eq "mn")
4019 0 0 unless $self->{'data'}{'def'}[4]
4022 1 0 if ($field eq "s")
4023 0 1 unless $self->{'data'}{'def'}[5]
4030 0 12 if ($self->{'err'} or not $self->{'data'}{'set'})
4039 0 12 unless ($zonename)
4050 0 12 if ($err)
4071 0 13 if ($self->{'err'} or not $self->{'data'}{'set'})
4089 1244 3271 if $dow < $dmb->_config("workweekbeg") or $dow > $dmb->_config("workweekend")
4095 559 2712 if ($checktime and not $dmb->_config("workday24hr"))
4100 129 430 if $t lt $t0 or $t gt $t1
4105 1111 2031 unless ($dmb->{'data'}{'init_holidays'})
4114 585 1530 if exists $dmb->{'data'}{'holidays'}{'dates'} and exists $dmb->{'data'}{'holidays'}{'dates'}{$y + 0} and exists $dmb->{'data'}{'holidays'}{'dates'}{$y + 0}{$m + 0} and exists $dmb->{'data'}{'holidays'}{'dates'}{$y + 0}{$m + 0}{$d + 0}
4124 1 83 if not $y and $self->{'data'}{'set'} == 1
4125 1 83 unless $y
4146 0 33 if ($self->{'err'} or not $self->{'data'}{'set'})
4158 23 10 if (exists $dmb->{'data'}{'holidays'}{'dates'}{$y + 0} and exists $dmb->{'data'}{'holidays'}{'dates'}{$y + 0}{$m + 0} and exists $dmb->{'data'}{'holidays'}{'dates'}{$y + 0}{$m + 0}{$d + 0})
4164 2 26 if $tmp =~ /DMunnamed/
4167 22 1 if (wantarray) { }
4168 0 22 unless @tmp
4171 0 1 unless @tmp
4180 0 12 if ($self->{'err'} or not $self->{'data'}{'set'})
4193 0 12 if ($self->{'err'} or not $self->{'data'}{'set'})
4214 244 211 if ($checktime) { }
4228 92 129 if ($prev) { }
4235 140 81 if $self->__is_business_day([$y, $m, $d, $h, $mn, $s])
4245 0 6 if ($self->{'err'} or not $self->{'data'}{'set'})
4256 4 2 unless defined $date
4266 4 2 if $self->__is_business_day($date, 0)
4271 2 0 unless defined $tomorrow
4274 2 0 if ($tomorrow) { }
4286 1 1 if ($self->__is_business_day([$y1, $m1, $d1, $h, $mn, $s], 0))
4291 1 0 if ($self->__is_business_day([$y2, $m2, $d2, $h, $mn, $s], 0))
4322 14 193 unless ($name)
4334 105 102 unless ($err)
4337 92 13 if ($date->{'data'}{'def'}[0] eq '') { }
4353 0 13 if (exists $dmb->{'data'}{'holidays'}{'hols'}{$name}{$y + 0})
4361 0 13 if (exists $dmb->{'data'}{'holidays'}{'dates'}{$y + 0}{$m + 0}{$d + 0}) { }
4376 102 0 unless ($err)
4395 3446 265 if $dmb->{'data'}{'holidays'}{'ydone'}{$year + 0}
4396 34 231 unless $dmb->{'data'}{'holidays'}{'init'}
4420 24 1350 if exists $dmb->{'data'}{'holidays'}{'hols'}{$name}{$year + 0}
4422 766 584 if (ref $obj) { }
4434 84 682 if ($obj->start and $obj->end) { }
4446 213 665 if (exists $dmb->{'data'}{'holidays'}{'dates'}{$y + 0}{$m + 0}{$d + 0}) { }
4461 8 576 if (exists $dmb->{'data'}{'holidays'}{'dates'}{$y + 0}{$m + 0}{$d + 0}) { }
4496 0 61 if ($self->{'err'} or not $self->{'data'}{'set'})
4512 0 698 if $in eq "%"
4516 288 410 if ($in =~ s/^([^%]+)//)
4523 20 390 if ($in =~ s/^%<([^>]+)>//)
4527 3 17 if ($f =~ /^a=([1-7])$/) { }
3 14 elsif ($f =~ /^v=([1-7])$/) { }
3 11 elsif ($f =~ /^A=([1-7])$/) { }
2 9 elsif ($f =~ /^p=([1-2])$/) { }
3 6 elsif ($f =~ /^b=(0?[1-9]|1[0-2])$/) { }
3 3 elsif ($f =~ /^B=(0?[1-9]|1[0-2])$/) { }
3 0 elsif ($f =~ /^E=(0?[1-9]|[1-4][0-9]|5[0-3])$/) { }
4560 43 347 if (exists $self->{'data'}{'f'}{$f})
4567 176 14 if (not $posix and exists $pad_0{$f} or $posix and exists $pad_0_pos{$f})
4572 24 40 if (not $posix and exists $pad_sp{$f} or $posix and exists $pad_sp_pos{$f})
4579 8 299 if ($f eq "G" or $f eq "W" or $f eq "L" or $f eq "U" or $f eq "g" and $posix or $f eq "V" and $posix)
4589 19 29 if ($f eq 'L' or $f eq 'U') { }
4595 16 32 if ($posix and $f eq 'G' || $f eq 'g' || $f eq 'V' || $f eq 'L') { }
4 28 elsif ($posix and $f eq 'W') { }
4 24 elsif ($posix and $f eq 'U') { }
4609 19 29 if ($f eq 'G' or $f eq 'L') { }
4 25 elsif ($f eq 'g') { }
4625 29 318 if ($f eq "Y" or $f eq "y")
4630 1 346 if ($f eq "C" and $posix)
4636 9 338 if ($f eq "m" or $f eq "f")
4641 30 317 if ($f eq "d" or $f eq "e")
4646 3 344 if ($f eq "j")
4652 35 40 if (not $posix and exists $hr{$f} or $posix and exists $hr_pos{$f})
4655 4 27 if ($f eq "I" or $f eq "i" or $f eq "l")
4656 2 6 if $val > 12
4657 0 8 if $val == 0
4662 24 323 if ($f eq "M")
4667 22 325 if ($f eq "S")
4672 36 35 if (not $posix and exists $dow{$f} or $posix and exists $dow_pos{$f})
4675 0 36 if $f eq "u" and $dow == 0
4682 203 144 if (not $posix and exists $num{$f} or $posix and exists $num_pos{$f}) { }
24 120 elsif ($f eq 'b' or $f eq 'h') { }
3 117 elsif ($f eq 'B') { }
2 115 elsif ($f eq 'v') { }
18 97 elsif ($f eq 'a') { }
3 94 elsif ($f eq 'A') { }
11 83 elsif ($f eq 'w') { }
5 78 elsif ($f eq 'p' or $f eq 'P' and $posix) { }
19 59 elsif ($f eq 'Z') { }
4 55 elsif ($f eq 'N') { }
4 51 elsif ($f eq 'z') { }
2 49 elsif ($f eq 'E') { }
2 47 elsif ($f eq 's') { }
2 45 elsif ($f eq 'o') { }
4 41 elsif ($f eq 'l' and not $posix) { }
1 40 elsif ($f eq 'c') { }
2 38 elsif ($f eq 'C' and not $posix or $f eq 'u') { }
13 25 elsif ($f eq 'g' and not $posix) { }
2 23 elsif ($f eq 'D') { }
1 22 elsif ($f eq 'r') { }
1 21 elsif ($f eq 'R') { }
2 19 elsif ($f eq 'T' or $f eq 'X') { }
1 18 elsif ($f eq 'V' and not $posix) { }
1 17 elsif ($f eq 'Q') { }
1 16 elsif ($f eq 'q') { }
1 15 elsif ($f eq 'P' and not $posix) { }
1 14 elsif ($f eq 'O') { }
2 12 elsif ($f eq 'F') { }
1 11 elsif ($f eq 'K') { }
2 9 elsif ($f eq 'x') { }
9 0 elsif ($f eq 'J') { }
0 0 elsif ($f eq 'n') { }
0 0 elsif ($f eq 't') { }
4688 5 198 if $f eq "y"
4709 1 4 $h >= 12 ? :
4711 1 4 if $f eq "P"
4746 2 2 if ($date lt $d0 or $date ge $d1) { }
4802 1 1 if ($posix) { }
4814 1 1 if ($dmb->_config('dateformat') eq 'US') { }
4822 4 5 if ($posix) { }
4839 302 45 if ($val ne "")
4847 49 12 if (wantarray) { }
12 0 elsif (@out == 1) { }
4862 0 21 if ($self->{'err'} or not $self->{'data'}{'set'})
4872 9 12 if (@args and $args[$#args] eq 'dates') { }
4879 4 17 if (@args and $#args == 0 and ref $args[0] eq 'Date::Manip::Date') { }
2 15 elsif (@args and $#args == 0 and $args[0] == 0) { }
0 15 elsif (@args) { }
4891 4 17 if ($date) { }
2 15 elsif ($day) { }
4905 0 21 if ($beg->cmp($end) == 1)
4925 129 102 if ($type eq 'specified') { }
52 50 elsif ($type eq 'ym' or $type eq 'date') { }
50 0 elsif ($type eq 'recur') { }
4932 52 0 if (exists $dmb->{'data'}{'events'}{$i}{$y})
4955 48 137 if $beg->cmp($d1) != 1 and $end->cmp($d0) != -1
4961 12 9 if ($format eq 'std') { }
9 0 elsif ($format eq 'dates') { }
4962 0 12 unless $Date::Manip::Date::a->[0]->cmp($Date::Manip::Date::b->[0]) or $Date::Manip::Date::a->[1]->cmp($Date::Manip::Date::b->[1])
4974 9 13 if ($e->[0]->cmp($beg) == -1) { }
4983 12 10 if ($d1->cmp($end) == -1)
4989 0 9 unless @tmp2
4990 0 43 unless $Date::Manip::Date::a->[0]->cmp($Date::Manip::Date::b->[0]) or $Date::Manip::Date::a->[1] cmp $Date::Manip::Date::b->[1]
5000 1 8 if ($beg->cmp($d) != 0)
5013 34 16 if ($d->cmp($d0) == 0)
5017 22 12 if ($op eq '+') { }
5023 25 9 if @tmp2
5034 9 16 unless @tmp2
5049 0 21 if exists $dmb->{'data'}{'eventyears'}{$y}
5050 3 18 unless $dmb->{'data'}{'eventobjs'}
5065 26 205 if ($type eq 'ym') { }
26 179 elsif ($type eq 'date') { }
5073 13 13 if ($end) { }
5090 0 26 if ($end) { }
26 0 elsif ($del) { }
5127 15 18 if ($#event == 0) { }
18 0 elsif ($#event == 1) { }
5133 6 9 unless ($err)
5134 2 4 if ($d1->{'data'}{'def'}[0] eq '') { }
5156 5 4 unless ($err)
5157 2 3 if ($d1->{'data'}{'def'}[0] eq '') { }
5180 0 4 if ($err)
5187 0 4 if (@d) { }
5212 9 9 unless ($err)
5215 0 9 if ($err) { }
0 9 elsif ($d1->{'data'}{'def'}[0] ne $d2->{'data'}{'def'}[0]) { }
5225 2 7 if ($d1->{'data'}{'def'}[0] eq '') { }
5248 6 3 unless ($err)
5253 2 4 unless ($err)
5255 0 2 if ($d1->{'data'}{'def'}[0] ne $d2->{'data'}{'def'}[0])
5262 0 2 if ($d1->{'data'}{'def'}[0] eq '') { }
5284 0 4 if ($err)
5291 2 2 if ($d1->{'data'}{'def'}[0] eq '') { }
5316 3 0 unless ($err)
5320 0 3 if ($err)
5329 0 3 if (@d) { }