diff --git a/Koha/Template/Plugin/KohaDates.pm b/Koha/Template/Plugin/KohaDates.pm index 00656fa590..882d51e04e 100644 --- a/Koha/Template/Plugin/KohaDates.pm +++ b/Koha/Template/Plugin/KohaDates.pm @@ -17,21 +17,20 @@ package Koha::Template::Plugin::KohaDates; # with Koha; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -use strict; -use warnings; +use Modern::Perl; use Template::Plugin::Filter; use base qw( Template::Plugin::Filter ); -use warnings; -use strict; -use C4::Dates; +use Koha::DateUtils; +our $DYNAMIC = 1; sub filter { - my ($self,$text) = @_; - return "" if not $text; - my $date = C4::Dates->new( $text, 'iso' ); - return $date->output("syspref"); + my ( $self, $text, $args, $config ) = @_; + return "" unless $text; + $config->{with_hours} //= 0; + my $dt = dt_from_string( $text, 'iso' ); + return output_pref( $dt, undef, undef, !$config->{with_hours} ); } 1; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt index 59848c25fd..1d7ec31914 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt @@ -1,3 +1,4 @@ +[% USE KohaDates %] [% INCLUDE 'doc-head-open.inc' %] Sent notices for [% INCLUDE 'patron-title.inc' %] [% INCLUDE 'doc-head-close.inc' %] @@ -72,7 +73,7 @@ [% ELSIF ( QUEUED_MESSAGE.status == 'deleted' ) %]deleted [% ELSE %][% QUEUED_MESSAGE.status %][% END %] - [% QUEUED_MESSAGE.time_queued %] + [% QUEUED_MESSAGE.time_queued | $KohaDates with_hours => 1 %] [% END %]