| 1 | package Test2::Harness::UI::Util::DateTimeFormat; | ||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 2 | ▶ | use Carp qw/confess/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 2 | ▶ | use Importer Importer => 'import'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 2 | our @EXPORT = qw/DTF/; | |||||||||
| 9 | |||||||||||
| 10 | 2 | my $DTF; | |||||||||
| 11 | 0 | ▶ | sub DTF { | ||||||||
|
Subroutine
DTF: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||
| 12 | 0 | ▶ | return $DTF if $DTF; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | |||||||||||
| 14 | 0 | ▶ | confess "You must first load a Test2::Harness::UI::Schema::NAME module" | ||||||||
|
Branch: 1 branch
| |||||||||||
| 15 | unless $Test2::Harness::UI::Schema::LOADED; | ||||||||||
| 16 | |||||||||||
| 17 | 0 | ▶ | if ($Test2::Harness::UI::Schema::LOADED =~ m/postgresql/i) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 0 | require DateTime::Format::Pg; | |||||||||
| 19 | 0 | return $DTF = 'DateTime::Format::Pg'; | |||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | 0 | ▶ | if ($Test2::Harness::UI::Schema::LOADED =~ m/mysql/i) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 0 | require DateTime::Format::MySQL; | |||||||||
| 24 | 0 | return $DTF = 'DateTime::Format::MySQL'; | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 0 | die "Not sure what DateTime::Formatter to use"; | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 2 | 1; | |||||||||