Merge branch 'bug_9479' into 3.12-master

This commit is contained in:
Jared Camins-Esakov 2013-03-30 23:37:14 -04:00
commit 6ffb8bd3d7
2 changed files with 10 additions and 10 deletions

View File

@ -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;

View File

@ -1,3 +1,4 @@
[% USE KohaDates %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Sent notices for [% INCLUDE 'patron-title.inc' %]</title>
[% INCLUDE 'doc-head-close.inc' %]
@ -72,7 +73,7 @@
[% 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>