From 51c369567a8403f40a31ea958f9e370ee3b50daf Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 23 Apr 2013 12:32:03 -0400 Subject: [PATCH] Bug 8735 - Expire holds waiting only on days the library is open - Followup - Switch from C4::Calendar to Koha::Calendar --- C4/Reserves.pm | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 2738677..bd3efed 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -36,9 +36,9 @@ use C4::Members qw(); use C4::Letters; use C4::Branch qw( GetBranchDetail ); use C4::Dates qw( format_date_in_iso ); -use C4::Calendar; use Koha::DateUtils; +use Koha::Calendar; use List::MoreUtils qw( firstidx ); @@ -914,7 +914,7 @@ sub CancelExpiredReserves { my $charge = C4::Context->preference("ExpireReservesMaxPickUpDelayCharge"); my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays'); - my $today = C4::Dates->new(); + my $today = dt_from_string(); my $query = "SELECT * FROM reserves WHERE TO_DAYS( NOW() ) - TO_DAYS( waitingdate ) > ? AND found = 'W' AND priority = 0"; $sth = $dbh->prepare( $query ); @@ -923,8 +923,8 @@ sub CancelExpiredReserves { while ( my $res = $sth->fetchrow_hashref ) { my $do_cancel = 1; unless ( $cancel_on_holidays ) { - my $calendar = C4::Calendar->new( branchcode => $res->{'branchcode'} ); - my $is_holiday = $calendar->isHoliday( split( '/', $today->output('metric') ) ); + my $calendar = Koha::Calendar->new( branchcode => $res->{'branchcode'} ); + my $is_holiday = $calendar->is_holiday( $today ); if ( $is_holiday ) { $do_cancel = 0; -- 1.7.2.5