From fdd3d3e93857e31f714c076643fa77b06ff9cd71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20V=C3=A9ron?= Date: Tue, 29 Sep 2015 11:50:44 +0200 Subject: [PATCH] Remove C4::Dates from circ/pendingreserves.pl This patch removes C4::Dates from circ/pendingreserves.pl To test: Apply patch Go to Home > Circulation > Holds to pull Verify that the the filter and the list behave as before. http://bugs.koha-community.org/show_bug.cgi?id=14918 --- circ/pendingreserves.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl index 947a9fe..a02d0ac 100755 --- a/circ/pendingreserves.pl +++ b/circ/pendingreserves.pl @@ -33,9 +33,9 @@ use C4::Context; use C4::Output; use CGI qw ( -utf8 ); use C4::Auth; -use C4::Dates qw/format_date format_date_in_iso/; use C4::Debug; use Date::Calc qw/Today Add_Delta_YMD/; +use Koha::DateUtils; my $input = new CGI; my $startdate=$input->param('from'); @@ -79,28 +79,28 @@ if (!defined($startdate) or $startdate eq "") { # changed from delivered range of 10 years-yesterday to 2 days ago-today # Find two days ago for the default shelf pull start date, unless HoldsToPullStartDate sys pref is set. my $pastdate= sprintf("%-04.4d-%-02.2d-%02.2d", Add_Delta_YMD($year, $month, $day, 0, 0, -C4::Context->preference('HoldsToPullStartDate')||TWO_DAYS_AGO )); - $startdate = format_date($pastdate); + $startdate = output_pref({ dt => dt_from_string( $pastdate ), dateonly => 1 }); } if (!defined($enddate) or $enddate eq "") { #similarly: calculate end date with ConfirmFutureHolds (days) my $d=sprintf("%-04.4d-%-02.2d-%02.2d", Add_Delta_YMD($year, $month, $day, 0, 0, C4::Context->preference('ConfirmFutureHolds')||0 )); - $enddate = format_date($d); + $enddate = output_pref({ dt => dt_from_string( $d ), dateonly => 1 }); } my @reservedata; if ( $run_report ) { my $dbh = C4::Context->dbh; my $sqldatewhere = ""; - $debug and warn format_date_in_iso($startdate) . "\n" . format_date_in_iso($enddate); + $debug and warn output_pref({ dt => dt_from_string( $startdate ), dateformat => 'iso', dateonly => 1 }) . "\n" . output_pref({ dt => dt_from_string( $enddate ), dateformat => 'iso', dateonly => 1 }); my @query_params = (); if ($startdate) { $sqldatewhere .= " AND reservedate >= ?"; - push @query_params, format_date_in_iso($startdate); + push @query_params, output_pref({ dt => dt_from_string( $startdate ), dateformat => 'iso', dateonly => 1 }); } if ($enddate) { $sqldatewhere .= " AND reservedate <= ?"; - push @query_params, format_date_in_iso($enddate); + push @query_params, output_pref({ dt => dt_from_string( $enddate ), dateformat => 'iso', dateonly => 1 }); } my $strsth = -- 1.7.10.4