# 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 init {
+ my $self = shift;
+ $self->{ _DYNAMIC } = 1;
+ return $self;
+}
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, !$config->{with_hours} );
}
1;
+[% USE KohaDates %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Sent notices for [% INCLUDE 'patron-title.inc' %]</title>
[% INCLUDE 'doc-head-close.inc' %]
[% ELSIF ( QUEUED_MESSAGE.status == 'deleted' ) %]deleted
[% ELSE %][% QUEUED_MESSAGE.status %][% END %]
</td>
- <td>[% QUEUED_MESSAGE.time_queued %]</td>
+ <td>[% QUEUED_MESSAGE.time_queued | $KohaDates with_hours => 1 %]</td>
</tr>
[% END %]
</tbody>