From 4c0d7b14bebcedb802488ee1fb200a2c7513ca91 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 29 Jun 2020 09:54:58 +0100 Subject: [PATCH] Bug 25850: (QA follow-up) Match logic in is_holiday Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize (cherry picked from commit afd88e1d21a5cb5f2198c058144065b64098c124) Signed-off-by: Lucas Gass --- Koha/Calendar.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Koha/Calendar.pm b/Koha/Calendar.pm index a3d3a1d0d1..059fc872c9 100644 --- a/Koha/Calendar.pm +++ b/Koha/Calendar.pm @@ -236,11 +236,18 @@ sub get_push_amt { my ( $self, $base_date) = @_; my $dow = $base_date->day_of_week; + # Representation fix + # DateTime object dow (1-7) where Monday is 1 + # Arrays are 0-based where 0 = Sunday, not 7. + if ( $dow == 7 ) { + $dow = 0; + } + return ( # We're using Dayweek useDaysMode option $self->{days_mode} eq 'Dayweek' && # It's not a permanently closed day - !$self->{weekly_closed_days}->[$dow % 7] + !$self->{weekly_closed_days}->[$dow] ) ? 7 : 1; } -- 2.39.5