Lines 5-11
use DateTime;
Link Here
|
5 |
use DateTime::TimeZone; |
5 |
use DateTime::TimeZone; |
6 |
|
6 |
|
7 |
use C4::Context; |
7 |
use C4::Context; |
8 |
use Test::More tests => 31; |
8 |
use Test::More tests => 32; |
9 |
use Test::MockModule; |
9 |
use Test::MockModule; |
10 |
|
10 |
|
11 |
BEGIN { use_ok('Koha::DateUtils'); } |
11 |
BEGIN { use_ok('Koha::DateUtils'); } |
Lines 67-72
cmp_ok $date_string, 'eq', '16/06/2011 12:00', 'metric output';
Link Here
|
67 |
$date_string = output_pref({ dt => $dt, dateformat => 'metric', timeformat => 'notime', dateonly => 1 }); |
67 |
$date_string = output_pref({ dt => $dt, dateformat => 'metric', timeformat => 'notime', dateonly => 1 }); |
68 |
cmp_ok $date_string, 'eq', '16/06/2011', 'metric output (date only)'; |
68 |
cmp_ok $date_string, 'eq', '16/06/2011', 'metric output (date only)'; |
69 |
|
69 |
|
|
|
70 |
$date_string = output_pref({ dt => $dt, dateformat => 'metric', timeformat => '24hr' }); |
71 |
cmp_ok $date_string, 'eq', '16/06/2011 12:00', |
72 |
'output_pref preserves non midnight HH:SS'; |
73 |
|
70 |
my $dear_dirty_dublin = DateTime::TimeZone->new( name => 'Europe/Dublin' ); |
74 |
my $dear_dirty_dublin = DateTime::TimeZone->new( name => 'Europe/Dublin' ); |
71 |
my $new_dt = dt_from_string( '16/06/2011', 'metric', $dear_dirty_dublin ); |
75 |
my $new_dt = dt_from_string( '16/06/2011', 'metric', $dear_dirty_dublin ); |
72 |
isa_ok( $new_dt, 'DateTime', 'Create DateTime with different timezone' ); |
76 |
isa_ok( $new_dt, 'DateTime', 'Create DateTime with different timezone' ); |
73 |
- |
|
|