Bug 14890: Simplify processing to display a date with hours
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 8 Oct 2015 08:52:27 +0000 (09:52 +0100)
committerTomas Cohen Arazi <tomascohen@theke.io>
Thu, 8 Oct 2015 13:59:05 +0000 (10:59 -0300)
The KohaDates plugin does that, it's not necessary to split the output.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
circ/bookcount.pl
koha-tmpl/intranet-tmpl/prog/en/modules/circ/bookcount.tt

index 610fd5e..09dc6fc 100755 (executable)
@@ -71,11 +71,8 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
 
 my $branchloop = GetBranchesLoop(C4::Context->userenv->{branch});
 foreach (@$branchloop) {
-    my $date = lastseenat( $itm, $_->{value} );
-    my ($datechunk, $timechunk) =  slashdate($date);
     $_->{issues}     = issuesat($itm, $_->{value});
-    $_->{seen}       = $datechunk;
-    $_->{seentime}   = $timechunk;
+    $_->{seen}       = lastseenat( $itm, $_->{value} ) || undef;
 }
 
 $template->param(
@@ -170,14 +167,3 @@ sub lastseenat {
     my $date = ( $date1 lt $date2 ) ? $date2 : $date1 ;
     return ($date);
 }
-
-#####################################################
-# return date and time from timestamp
-sub slashdate {
-    my ($date) = @_;
-    $date or return;
-    return (
-        output_pref({ dt => dt_from_string( $date ), dateonly => 1 }),
-        substr($date,11,5)
-    );
-}
index e83955f..f7b4765 100644 (file)
@@ -48,7 +48,7 @@ $(document).ready(function(){
             <td>[% branchloo.branchname %]</td>
             <td>[% branchloo.issues %]</td>
             <td>[% IF ( branchloo.seen ) %]
-                    [% branchloo.seen %] [% branchloo.seentime %]
+                    [% branchloo.seen | $KohaDates with_hours => 1 %]
                 [% ELSE %]
                     <span>Never</span>
                 [% END %]