Bug 38633

Summary: Calendar - Weekly closures are ignored when setting a yearly repeating holiday
Product: Koha Reporter: Jeremy Evans <jeremy.evans>
Component: HolidaysAssignee: Alexander Blanchard <alexander.blanchard>
Status: Signed Off --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: alexander.blanchard, aude.charillon, jeremy.evans, marion.durand
Version: 23.11   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 38633: Prevent holidays from being ignored
Bug 38633: Prevent holidays from being ignored
Bug 38633: Prevent holidays from being ignored

Description Jeremy Evans 2024-12-05 14:46:54 UTC
There seems to be an issue in Koha when setting up a yearly repeating holiday in a range. Currently running Koha 23.11.10   I had not noticed this issue in previous versions - we would have been running 22.11 when I last set up a repeating closure range.
 
We set in the calendar a yearly closure period from 20 December to 6 January each year.    This year 21/22 December and also 28/29 December are weekends when the library is already closed.
 
However if I look at the 2025 or 2026 calendars, those dates which are weekends in 2024 are showing as open if they are on a weekday in 2025 or 2026. They should be closed as they are still within the date range of the yearly repeating closure.

On testing it appears that, if weekly repeatable holidays are set, Koha ignores those days in the holidays on a range (presumably because they are already marked as closed). 
You can see this clearly because they do not appear in the list of dates on the right.  This does become an issue when you are using holidays on a range repeatable yearly.

Our temporary workaround was to remove all of the repeating holidays. Then add in the Christmas/ New year closure range and the add back in the weekly Saturday and Sunday closures. It appears to be necessary to set the yearly repeatable holidays on a range first, and to add the weekly repeatable holidays afterwards.
Comment 1 Alexander Blanchard 2025-04-03 10:41:45 UTC
Created attachment 180489 [details] [review]
Bug 38633: Prevent holidays from being ignored

If weekly repeatable holidays are set, Koha ignores these days when other holidays are set using the Holidays repeated yearly on a range option.

To test:
1) Navigate to Tools > Calendar
2) Click on a weekend date on the calendar to open the Add New Holiday option
3) Give your holiday a title and select Holiday repeated every same day of the week
4) Click on the calendar again and set a holiday from 20 December 2021 to 06 January 2022
5) Give your holiday a title
6) Select Holidays repeated yearly on a range and click save
7) Using the calendar, navigate forwards to December 2024 and note that there are days that should be highlighted in the holdiay period that are not highlighted
8) Apply Patch
9) Run the reset_all command
10) Repeat the steps above
11) Notice that now when you click forwards through the calendar, all of the dates for your holidays repeated yearly on a range are still selected
Comment 2 Marion Durand 2025-04-03 13:49:21 UTC
Created attachment 180533 [details] [review]
Bug 38633: Prevent holidays from being ignored

If weekly repeatable holidays are set, Koha ignores these days when other holidays are set using the Holidays repeated yearly on a range option.

To test:
1) Navigate to Tools > Calendar
2) Click on a weekend date on the calendar to open the Add New Holiday option
3) Give your holiday a title and select Holiday repeated every same day of the week
4) Click on the calendar again and set a holiday from 20 December 2021 to 06 January 2022
5) Give your holiday a title
6) Select Holidays repeated yearly on a range and click save
7) Using the calendar, navigate forwards to December 2024 and note that there are days that should be highlighted in the holdiay period that are not highlighted
8) Apply Patch
9) Run the reset_all command
10) Repeat the steps above
11) Notice that now when you click forwards through the calendar, all of the dates for your holidays repeated yearly on a range are still selected

Signed-off-by: Marion Durand <marion.durand@biblibre.com>
Comment 3 Alexander Blanchard 2025-04-08 16:14:56 UTC
Created attachment 180728 [details] [review]
Bug 38633: Prevent holidays from being ignored

If weekly repeatable holidays are set, Koha ignores these days when other holidays are set using the Holidays repeated yearly on a range option.

To test:
1) Navigate to Tools > Calendar
2) Click on a weekend date on the calendar to open the Add New Holiday option
3) Give your holiday a title and select Holiday repeated every same day of the week
4) Click on the calendar again and set a holiday from 20 December 2021 to 06 January 2022
5) Give your holiday a title
6) Select Holidays repeated yearly on a range and click save
7) Using the calendar, navigate forwards to December 2024 and note that there are days that should be highlighted in the holdiay period that are not highlighted
8) Apply Patch
9) Run the reset_all command
10) Repeat the steps above
11) Notice that now when you click forwards through the calendar, all of the dates for your holidays repeated yearly on a range are still selected
Comment 4 Alexander Blanchard 2025-04-08 16:15:27 UTC
Updated POD