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