View | Details | Raw Unified | Return to bug 21824
Collapse All | Expand All

(-)a/Koha/Template/Plugin/KohaDates.pm (+5 lines)
Lines 37-40 sub filter { Link Here
37
        output_pref({ dt => $dt, dateonly => !$config->{with_hours}, dateformat => $config->{dateformat} });
37
        output_pref({ dt => $dt, dateonly => !$config->{with_hours}, dateformat => $config->{dateformat} });
38
}
38
}
39
39
40
sub output_preference {
41
    my ( $self, @params ) = @_;
42
    return output_pref( @params );
43
}
44
40
1;
45
1;
(-)a/t/db_dependent/Template/Plugin/KohaDates.t (-2 / +5 lines)
Lines 1-10 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
use C4::Context;
5
use C4::Context;
5
use Koha::DateUtils;
6
use Koha::DateUtils;
6
use Test::More tests => 8;
7
7
use Test::MockModule;
8
use Test::MockModule;
9
use Test::More tests => 9;
8
use t::lib::Mocks;
10
use t::lib::Mocks;
9
11
10
BEGIN {
12
BEGIN {
Lines 51-56 is( $filtered_date, '01/04/1979', 'us: dt_from_string should return the valid da Link Here
51
$filtered_date = $filter->filter('1979-04-01', undef, { dateformat => 'iso' } );
53
$filtered_date = $filter->filter('1979-04-01', undef, { dateformat => 'iso' } );
52
is( $filtered_date, '1979-04-01', 'date should be returned in ISO if dateformat is passed with a value of iso' );
54
is( $filtered_date, '1979-04-01', 'date should be returned in ISO if dateformat is passed with a value of iso' );
53
55
56
is( Koha::DateUtils::output_pref( dt_from_string ), $filter->output_preference( dt_from_string ), 'Filter output_preference method output matches output_pref' );
57
54
$module_context->mock(
58
$module_context->mock(
55
    'tz',
59
    'tz',
56
    sub {
60
    sub {
57
- 

Return to bug 21824