File Coverage

blib/lib/DBIx/Class/Helper/Schema/DateTime.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 0 3 0.0
total 18 21 85.7


line stmt bran cond sub pod time code
1             package DBIx::Class::Helper::Schema::DateTime;
2             $DBIx::Class::Helper::Schema::DateTime::VERSION = '2.035000';
3             # ABSTRACT: DateTime helper
4              
5 1     1   797 use strict;
  1         2  
  1         32  
6 1     1   10 use warnings;
  1         2  
  1         28  
7              
8 1     1   6 use parent 'DBIx::Class::Schema';
  1         3  
  1         9  
9              
10 5     5 0 105614 sub datetime_parser { return shift->storage->datetime_parser }
11              
12 1     1 0 143 sub parse_datetime { return shift->datetime_parser->parse_datetime(@_) }
13              
14 3     3 0 77728 sub format_datetime { return shift->datetime_parser->format_datetime(@_) }
15              
16             1;
17              
18             __END__
19              
20             =pod
21              
22             =head1 NAME
23              
24             DBIx::Class::Helper::Schema::DateTime - DateTime helper
25              
26             =head1 SYNOPSIS
27              
28             package MyApp::Schema;
29              
30             __PACKAGE__->load_components('Helper::Schema::DateTime');
31              
32             ...
33              
34             $schema->resultset('Book')->search({
35             written_on => $schema->format_datetime(DateTime->now)
36             });
37              
38             =head1 AUTHOR
39              
40             Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>
41              
42             =head1 COPYRIGHT AND LICENSE
43              
44             This software is copyright (c) 2020 by Arthur Axel "fREW" Schmidt.
45              
46             This is free software; you can redistribute it and/or modify it under
47             the same terms as the Perl 5 programming language system itself.
48              
49             =cut