From 17657b6094bbe7d52822e2729cca6bae1bfe8b43 Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Fri, 17 Jun 2011 16:34:46 +0100 Subject: [PATCH] Bug 5549 : Duedate formatting : reserves and opac --- opac/opac-readingrecord.pl | 6 +++--- opac/opac-reserve.pl | 3 ++- reserve/renewscript.pl | 4 ++-- reserve/request.pl | 3 ++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/opac/opac-readingrecord.pl b/opac/opac-readingrecord.pl index 00a91db39b..5a10fb5b82 100755 --- a/opac/opac-readingrecord.pl +++ b/opac/opac-readingrecord.pl @@ -25,8 +25,8 @@ use C4::Auth; use C4::Koha; use C4::Biblio; use C4::Circulation; -use C4::Dates qw/format_date/; use C4::Members; +use Koha::DateUtils; use C4::Output; @@ -89,8 +89,8 @@ foreach my $issue (@{$issues} ) { $line{title} = $issue->{'title'}; $line{author} = $issue->{'author'}; $line{itemcallnumber} = $issue->{'itemcallnumber'}; - $line{date_due} = format_date( $issue->{'date_due'} ); - $line{returndate} = format_date( $issue->{'returndate'} ); + $line{date_due} = format_sqldatetime( $issue->{date_due} ); + $line{returndate} = format_sqldatetime( $issue->{returndate} ); $line{volumeddesc} = $issue->{'volumeddesc'}; $issue->{'itemtype'} = C4::Context->preference('item-level_itypes') ? $issue->{'itype'} : $issue->{'itemtype'}; if($issue->{'itemtype'}) { diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index b2144a9192..04b66f6ce0 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -31,6 +31,7 @@ use C4::Members; use C4::Branch; # GetBranches use C4::Overdues; use C4::Debug; +use Koha::DateUtils; # use Data::Dumper; my $MAXIMUM_NUMBER_OF_RESERVES = C4::Context->preference("maxreserves"); @@ -397,7 +398,7 @@ foreach my $biblioNum (@biblionumbers) { # change the background color. my $issues= GetItemIssue($itemNum); if ( $issues->{'date_due'} ) { - $itemLoopIter->{dateDue} = format_date($issues->{'date_due'}); + $itemLoopIter->{dateDue} = format_sqldatetime$issues->{date_due}); $itemLoopIter->{backgroundcolor} = 'onloan'; } diff --git a/reserve/renewscript.pl b/reserve/renewscript.pl index f4c7fb4125..4b80d64288 100755 --- a/reserve/renewscript.pl +++ b/reserve/renewscript.pl @@ -27,7 +27,7 @@ use CGI; use C4::Circulation; use C4::Auth; use URI::Escape; -use C4::Dates qw/format_date_in_iso/; +use Koha::DateUtils; my $input = new CGI; #Set Up User_env @@ -66,7 +66,7 @@ if ($input->param('return_all')) { my $branch=$input->param('branch'); my $datedue; if ($input->param('newduedate')){ - $datedue=C4::Dates->new($input->param('newduedate')); + $datedue = dt_from_string($input->param('newduedate'); } # warn "barcodes : @barcodes"; diff --git a/reserve/request.pl b/reserve/request.pl index 24557f4c4c..b96447f8cc 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -42,6 +42,7 @@ use C4::Circulation; use C4::Dates qw/format_date/; use C4::Members; use C4::Search; # enabled_staff_search_views +use Koha::DateUtils; my $dbh = C4::Context->dbh; my $sth; @@ -367,7 +368,7 @@ foreach my $biblionumber (@biblionumbers) { # change the background color my $issues= GetItemIssue($itemnumber); if ( $issues->{'date_due'} ) { - $item->{date_due} = format_date($issues->{'date_due'}); + $item->{date_due} = format_sqldatetime($issues->{date_due}); $item->{backgroundcolor} = 'onloan'; } -- 2.39.5