my $dt = dt_from_string( $text, 'iso' );
return $config->{as_due_date} ?
output_pref({ dt => $dt, as_due_date => 1 }) :
output_pref({ dt => $dt, as_due_date => 1, dateformat => $config->{dateformat} }) :
output_pref({ dt => $dt, dateonly => !$config->{with_hours} });
output_pref({ dt => $dt, dateonly => !$config->{with_hours}, dateformat => $config->{dateformat} });
}
1;
use Modern::Perl;
use C4::Context;
use Koha::DateUtils;
use Test::More tests => 7;
use Test::More tests => 8;
use Test::MockModule;
use t::lib::Mocks;
);
$filtered_date = $filter->filter('1979-04-01');
is( $filtered_date, '01/04/1979', 'us: dt_from_string should return the valid date if a DST is given' );
is( $filtered_date, '01/04/1979', 'us: dt_from_string should return the valid date if a dst is given' );
$filtered_date = $filter->filter('1979-04-01', undef, { dateformat => 'iso' } );
is( $filtered_date, '1979-04-01', 'date should be returned in ISO if dateformat is passed with a value of iso' );
$module_context->mock(
'tz',
-