| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Catmandu::Fix::Date; |
|
2
|
1
|
|
|
1
|
|
408
|
use strict; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
33
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = "0.0130"; |
|
4
|
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
360
|
use parent 'Exporter'; |
|
|
1
|
|
|
|
|
221
|
|
|
|
1
|
|
|
|
|
4
|
|
|
6
|
|
|
|
|
|
|
our @EXPORT; |
|
7
|
|
|
|
|
|
|
@EXPORT = qw( |
|
8
|
|
|
|
|
|
|
datetime_format |
|
9
|
|
|
|
|
|
|
end_day |
|
10
|
|
|
|
|
|
|
end_week |
|
11
|
|
|
|
|
|
|
end_year |
|
12
|
|
|
|
|
|
|
split_date |
|
13
|
|
|
|
|
|
|
start_day |
|
14
|
|
|
|
|
|
|
start_week |
|
15
|
|
|
|
|
|
|
start_year |
|
16
|
|
|
|
|
|
|
timestamp |
|
17
|
|
|
|
|
|
|
); |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
foreach my $fix (@EXPORT) { |
|
20
|
|
|
|
|
|
|
eval <<EVAL; ## no critic |
|
21
|
|
|
|
|
|
|
require Catmandu::Fix::$fix; |
|
22
|
|
|
|
|
|
|
Catmandu::Fix::$fix ->import( as => '$fix' ); |
|
23
|
|
|
|
|
|
|
EVAL |
|
24
|
|
|
|
|
|
|
die "Failed to use Catmandu::Fix::$fix\n" if $@; |
|
25
|
|
|
|
|
|
|
} |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
|
29
|
|
|
|
|
|
|
__END__ |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 NAME |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Catmandu::Fix::Date - Catmandu fixes for processing dates |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=begin markdown |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# STATUS |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
[](https://travis-ci.org/LibreCat/Catmandu-Fix-Date) |
|
40
|
|
|
|
|
|
|
[](https://coveralls.io/r/LibreCat/Catmandu-Fix-Date) |
|
41
|
|
|
|
|
|
|
[](http://cpants.cpanauthors.org/dist/Catmandu-Fix-Date) |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=end markdown |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
use Catmandu::Fix::Date; |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# all fix functions are exported by default |
|
50
|
|
|
|
|
|
|
my $item = { date => '2001-11-09' }; |
|
51
|
|
|
|
|
|
|
split_date($item, 'date'); |
|
52
|
|
|
|
|
|
|
# $item == { date => { year => 2001, month => 11, day => 9 } } |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Catmandu::Fix::Date includes the following L<Catmandu::Fix> functions for |
|
57
|
|
|
|
|
|
|
processing dates: |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=over |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=item |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
L<Catmandu::Fix::datetime_format> |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=item |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
L<Catmandu::Fix::timestamp> |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=item |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
L<Catmandu::Fix::start_day> |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=item |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
L<Catmandu::Fix::end_day> |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=item |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
L<Catmandu::Fix::start_week> |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=item |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
L<Catmandu::Fix::end_week> |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=item |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
L<Catmandu::Fix::start_year> |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=item |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
L<Catmandu::Fix::end_year> |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=item |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
L<Catmandu::Fix::split_date> |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=back |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head1 AUTHOR |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
Nicolas Franck, C<< <nicolas.franck at ugent.be> >> |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
|
106
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
|
107
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
See L<http://dev.perl.org/licenses/> for more information. |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=cut |