@@ -, +, @@ day's open hours --- C4/Circulation.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -3897,7 +3897,10 @@ sub CalcDateDue { # starter vars so don't do calculations directly to $datedue my $potential_datedue = $datedue->clone; my $library_close = $datedue->clone; - my $dayofweek = $datedue->local_day_of_week - 1; + my $dayofweek = $datedue->day_of_week - 1; + my $tomorrow_dayofweek = $dayofweek + 1; + # If it's Sunday and tomorrow would be == 7, make tomorrow 0 (Days are stored as 0-6) + if ( $tomorrow_dayofweek > 6 ) { $tomorrow_dayofweek = 0; } my $todayhours = Koha::Library::Hours->find({ library_id => $branch, day => $dayofweek }); my @close = undef; my $tomorrowhours = Koha::Library::Hours->find({ library_id => $branch, day => $dayofweek+1 }); # get open hours of next day --