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

(-)a/Koha/Template/Plugin/KohaDates.pm (-9 / +14 lines)
Lines 17-37 package Koha::Template::Plugin::KohaDates; Link Here
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
19
20
use strict;
20
use Modern::Perl;
21
use warnings;
22
21
23
use Template::Plugin::Filter;
22
use Template::Plugin::Filter;
24
use base qw( Template::Plugin::Filter );
23
use base qw( Template::Plugin::Filter );
25
use warnings;
26
use strict;
27
24
28
use C4::Dates;
25
use Koha::DateUtils;
26
our $DYNAMIC = 1;
27
28
sub init {
29
    my $self = shift;
30
    $self->{ _DYNAMIC } = 1;
31
    return $self;
32
}
29
33
30
sub filter {
34
sub filter {
31
    my ($self,$text) = @_;
35
    my ( $self, $text, $args, $config ) = @_;
32
    return "" if not $text;
36
    return "" unless $text;
33
    my $date = C4::Dates->new( $text, 'iso' );
37
    $config->{with_hours} //= 0;
34
    return $date->output("syspref");
38
    my $dt = dt_from_string( $text, 'iso' );
39
    return output_pref( $dt, undef, !$config->{with_hours} );
35
}
40
}
36
41
37
1;
42
1;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt (-2 / +2 lines)
Lines 1-3 Link Here
1
[% USE KohaDates %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Sent notices for [% INCLUDE 'patron-title.inc' %]</title>
3
<title>Sent notices for [% INCLUDE 'patron-title.inc' %]</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
Lines 72-78 Link Here
72
            [% ELSIF ( QUEUED_MESSAGE.status == 'deleted' ) %]deleted
73
            [% ELSIF ( QUEUED_MESSAGE.status == 'deleted' ) %]deleted
73
            [% ELSE %][% QUEUED_MESSAGE.status %][% END %]
74
            [% ELSE %][% QUEUED_MESSAGE.status %][% END %]
74
        </td>
75
        </td>
75
		<td>[% QUEUED_MESSAGE.time_queued %]</td>
76
		<td>[% QUEUED_MESSAGE.time_queued | $KohaDates with_hours => 1 %]</td>
76
	    </tr>
77
	    </tr>
77
	    [% END %]
78
	    [% END %]
78
	</tbody>
79
	</tbody>
79
- 

Return to bug 9479