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

(-)a/Koha/DateUtils.pm (-1 / +2 lines)
Lines 123-129 sub output_pref { Link Here
123
123
124
    return unless defined $dt;
124
    return unless defined $dt;
125
125
126
    $dt->set_time_zone( C4::Context->tz );
126
    my $tz = $dateonly ? DateTime::TimeZone->new(name => 'floating') : C4::Context->tz;
127
    $dt->set_time_zone( $tz );
127
128
128
    my $pref =
129
    my $pref =
129
      defined $force_pref ? $force_pref : C4::Context->preference('dateformat');
130
      defined $force_pref ? $force_pref : C4::Context->preference('dateformat');
(-)a/Koha/Template/Plugin/KohaDates.pm (-2 / +4 lines)
Lines 29-35 sub filter { Link Here
29
    my ( $self, $text, $args, $config ) = @_;
29
    my ( $self, $text, $args, $config ) = @_;
30
    return "" unless $text;
30
    return "" unless $text;
31
    $config->{with_hours} //= 0;
31
    $config->{with_hours} //= 0;
32
    my $dt = dt_from_string( $text, 'iso' );
32
33
    my $tz = DateTime::TimeZone->new(name => 'floating') unless $config->{with_hours};
34
    my $dt = dt_from_string( $text, 'iso', $tz );
35
33
    return $config->{as_due_date} ?
36
    return $config->{as_due_date} ?
34
        output_pref({ dt => $dt, as_due_date => 1 }) :
37
        output_pref({ dt => $dt, as_due_date => 1 }) :
35
        output_pref({ dt => $dt, dateonly => !$config->{with_hours} });
38
        output_pref({ dt => $dt, dateonly => !$config->{with_hours} });
36
- 

Return to bug 12669