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

(-)a/C4/Letters.pm (+5 lines)
Lines 40-45 use Koha::Patrons; Link Here
40
use Koha::SMS::Providers;
40
use Koha::SMS::Providers;
41
use Koha::SMTP::Servers;
41
use Koha::SMTP::Servers;
42
use Koha::Subscriptions;
42
use Koha::Subscriptions;
43
use Koha::Template::Plugin::KohaDates;
43
44
44
use constant SERIALIZED_EMAIL_CONTENT_TYPE => 'message/rfc822';
45
use constant SERIALIZED_EMAIL_CONTENT_TYPE => 'message/rfc822';
45
46
Lines 638-643 sub GetPreparedLetter { Link Here
638
        $lang = shift @languages;
639
        $lang = shift @languages;
639
    }
640
    }
640
641
642
    $Template::Stash::SCALAR_OPS->{strftime} = sub {
643
        return Koha::Template::Plugin::KohaDates->strftime(@_);
644
    };
645
641
    $letter->{content} = _process_tt(
646
    $letter->{content} = _process_tt(
642
        {
647
        {
643
            content    => $letter->{content},
648
            content    => $letter->{content},
(-)a/Koha/Template/Plugin/KohaDates.pm (-1 / +10 lines)
Lines 67-70 sub tz { Link Here
67
    return C4::Context->tz->name;
67
    return C4::Context->tz->name;
68
}
68
}
69
69
70
sub strftime {    # used as TT virtual method for scalars, wrapper around DateTime counterpart
71
    my ( $self, $value, $format, $locale ) = @_;
72
    my $dt = eval { dt_from_string($value) };
73
    if ($dt) {
74
        $dt->set_locale($locale) if $locale;
75
        return $dt->strftime($format);
76
    }
77
    return $value;
78
}
79
70
1;
80
1;
71
- 

Return to bug 38758