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

(-)a/Koha/Template/Plugin/KohaDates.pm (-2 / +2 lines)
Lines 33-40 sub filter { Link Here
33
    my $dt = dt_from_string( $text, 'iso' );
33
    my $dt = dt_from_string( $text, 'iso' );
34
34
35
    return $config->{as_due_date} ?
35
    return $config->{as_due_date} ?
36
        output_pref({ dt => $dt, as_due_date => 1 }) :
36
        output_pref({ dt => $dt, as_due_date => 1, dateformat => $config->{dateformat} }) :
37
        output_pref({ dt => $dt, dateonly => !$config->{with_hours} });
37
        output_pref({ dt => $dt, dateonly => !$config->{with_hours}, dateformat => $config->{dateformat} });
38
}
38
}
39
39
40
1;
40
1;
(-)a/t/db_dependent/Template/Plugin/KohaDates.t (-3 / +5 lines)
Lines 3-9 Link Here
3
use Modern::Perl;
3
use Modern::Perl;
4
use C4::Context;
4
use C4::Context;
5
use Koha::DateUtils;
5
use Koha::DateUtils;
6
use Test::More tests => 7;
6
use Test::More tests => 8;
7
use Test::MockModule;
7
use Test::MockModule;
8
use t::lib::Mocks;
8
use t::lib::Mocks;
9
9
Lines 46-52 $module_context->mock( Link Here
46
);
46
);
47
47
48
$filtered_date = $filter->filter('1979-04-01');
48
$filtered_date = $filter->filter('1979-04-01');
49
is( $filtered_date, '01/04/1979', 'us: dt_from_string should return the valid date if a DST is given' );
49
is( $filtered_date, '01/04/1979', 'us: dt_from_string should return the valid date if a dst is given' );
50
51
$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' );
50
53
51
$module_context->mock(
54
$module_context->mock(
52
    'tz',
55
    'tz',
53
- 

Return to bug 21824