@@ -, +, @@ --- Koha/DiscreteCalendar.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/Koha/DiscreteCalendar.pm +++ a/Koha/DiscreteCalendar.pm @@ -1143,7 +1143,8 @@ sub open_hours_between { branchcode => $branchcode, }, { - where => \['date = DATE(?)', $start_date], + order_by => \[ 'ABS(DATEDIFF(date, ?))', $start_date ], + rows => 1, } ); @@ -1152,7 +1153,8 @@ sub open_hours_between { branchcode => $branchcode, }, { - where => \['date = DATE(?)', $end_date], + order_by => \[ 'ABS(DATEDIFF(date, ?))', $end_date ], + rows => 1, } ); --