Lines 4-10
use DateTime::TimeZone;
Link Here
|
4 |
|
4 |
|
5 |
use C4::Context; |
5 |
use C4::Context; |
6 |
|
6 |
|
7 |
use Test::More tests => 76; |
7 |
use Test::More tests => 78; |
8 |
|
8 |
|
9 |
use Test::MockModule; |
9 |
use Test::MockModule; |
10 |
use Test::Warn; |
10 |
use Test::Warn; |
Lines 258-264
$dt = dt_from_string('2015-01-31 01:02 PM');
Link Here
|
258 |
is( output_pref( {dt => $dt} ), '31/01/2015 13:02', 'dt_from_string ' ); |
258 |
is( output_pref( {dt => $dt} ), '31/01/2015 13:02', 'dt_from_string ' ); |
259 |
$dt = dt_from_string('2015-01-31 01:02:03 PM'); |
259 |
$dt = dt_from_string('2015-01-31 01:02:03 PM'); |
260 |
is( output_pref( {dt => $dt} ), '31/01/2015 13:02', 'dt_from_string ' ); |
260 |
is( output_pref( {dt => $dt} ), '31/01/2015 13:02', 'dt_from_string ' ); |
261 |
|
261 |
$dt = dt_from_string('2015-01-31 12:02 AM'); |
|
|
262 |
is( output_pref( {dt => $dt} ), '31/01/2015 12:02', 'dt_from_string ' ); |
263 |
$dt = dt_from_string('2015-01-31 12:02:03 AM'); |
264 |
is( output_pref( {dt => $dt} ), '31/01/2015 12:02', 'dt_from_string ' ); |
265 |
|
266 |
t::lib::Mocks::mock_preference('TimeFormat', '12hr'); |
267 |
$dt = DateTime->new( year => 2020, month => 5, day => 28, hour => 12, minute => 49 ); |
268 |
my $output = output_pref({ dt => $dt, dateformat => 'iso' }); |
269 |
$dt = dt_from_string( $output, 'iso' ); |
270 |
t::lib::Mocks::mock_preference('TimeFormat', '24hr'); |
262 |
|
271 |
|
263 |
# output_pref with no parameters, single parameter (no hash) |
272 |
# output_pref with no parameters, single parameter (no hash) |
264 |
is( output_pref(), undef, 'Call output_pref without parameters' ); |
273 |
is( output_pref(), undef, 'Call output_pref without parameters' ); |
265 |
- |
|
|