File Coverage

blib/lib/Data/Cleaner/Datetime.pm
Criterion Covered Total %
statement 16 16 100.0
branch 2 2 100.0
condition n/a
subroutine 7 7 100.0
pod n/a
total 25 25 100.0


line stmt bran cond sub pod time code
1             package Data::Cleaner::Datetime;
2              
3 1     1   4 use strict;
  1         2  
  1         30  
4 1     1   5 use warnings;
  1         2  
  1         23  
5              
6 1     1   737 use Date::Parse qw(str2time);
  1         4910  
  1         89  
7 1     1   967 use Date::Format qw(time2str);
  1         2961  
  1         212  
8              
9             our $VERSION = 0.0.1;
10             our $DEFAULT = '';
11              
12             sub _validate {
13 2     2   10 my $seconds = str2time($_[1]);
14 2 100       631 $seconds ? return $seconds : return undef;
15             }
16              
17             sub _fix {
18 1     1   6 return $_[0]->get_default;
19             }
20              
21             sub _format {
22 1     1   6 return time2str($_[0]->get_datetime_format(), $_[1], $_[0]->get_timezone());
23             }
24              
25             1;
26              
27             __END__