From d63691d3f196b86db49dc6f7c6c1e27cc53d0326 Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Fri, 17 Jun 2011 15:02:46 +0100 Subject: [PATCH] Bug 5549: Formatting duedates in catalogue scripts --- catalogue/detail.pl | 6 ++++-- catalogue/issuehistory.pl | 10 +++++----- catalogue/moredetail.pl | 5 +++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index db38551fde..da62e07e50 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -39,6 +39,7 @@ use C4::Tags qw(get_tags); use C4::VirtualShelves; use C4::XSLT; use C4::Images; +use Koha::DateUtils; # use Smart::Comments; @@ -192,9 +193,10 @@ foreach my $item (@items) { $item->{imageurl} = defined $item->{itype} ? getitemtypeimagelocation('intranet', $itemtypes->{ $item->{itype} }{imageurl}) : ''; - foreach (qw(datedue datelastseen onloan)) { + foreach (qw(datelastseen onloan)) { $item->{$_} = format_date($item->{$_}); - } + } + $item->{datedue} = format_sqldatetime($item->{datedue}); # item damaged, lost, withdrawn loops $item->{itemlostloop} = GetAuthorisedValues($authvalcode_items_itemlost, $item->{itemlost}) if $authvalcode_items_itemlost; if ($item->{damaged}) { diff --git a/catalogue/issuehistory.pl b/catalogue/issuehistory.pl index 3fb936ec36..2d415e14e9 100755 --- a/catalogue/issuehistory.pl +++ b/catalogue/issuehistory.pl @@ -67,11 +67,11 @@ if ($itemnumber){ %{$biblio[0]}, ); } -foreach (@$issues){ - $_->{date_due} = format_date($_->{date_due}); - $_->{issuedate} = format_date($_->{issuedate}); - $_->{returndate} = format_date($_->{returndate}); - $_->{lastreneweddate} = format_date($_->{lastreneweddate}); +foreach (@{$issues}){ + $_->{date_due} = format_sqldatetime($_->{date_due}); + $_->{issuedate} = format_sqldatetime($_->{issuedate}); + $_->{returndate} = format_sqldatetime($_->{returndate}); + $_->{lastreneweddate} = format_sqldatetime($_->{lastreneweddate}); } $template->param( total => scalar @$issues, diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index f5bb90452b..1a3a2d0b4a 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -35,6 +35,7 @@ use C4::Circulation; # to use itemissues use C4::Members; # to use GetMember use C4::Search; # enabled_staff_search_views use C4::Members qw/GetHideLostItemsPreference/; +use Koha::DateUtils; my $query=new CGI; @@ -162,8 +163,8 @@ foreach my $item (@items){ } $item->{'homebranchname'} = GetBranchName($item->{'homebranch'}); $item->{'holdingbranchname'} = GetBranchName($item->{'holdingbranch'}); - if ($item->{'datedue'}) { - $item->{'datedue'} = format_date($item->{'datedue'}); + if ($item->{datedue}) { + $item->{datedue} = format_sqldatetime($item->{datedue}); $item->{'issue'}= 1; } else { $item->{'issue'}= 0; -- 2.39.5