From 9652753b91b01648032612f9c65f58d9e3649156 Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Wed, 1 Jun 2022 14:36:52 +0200
Subject: [PATCH] Bug 30726: Fix "yesterday" when limited to past dates

Test plan:
Go to "Patrons with no checkouts" report, /cgi-bin/koha/reports/borrowers_out.pl
Select "Yesterday"
=> it automatically selects the previous day's date and populates the form field

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
---
 koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc
index 47a3f76ec2..2432225d21 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc
@@ -148,7 +148,7 @@
                 disable_buttons.push(2); /* Tomorrow */
             }
             if( $(this).data("flatpickr-pastdate") === true ) {
-                options['maxDate'] = new Date().fp_incr(-1);
+                options['maxDate'] = new Date().fp_incr(-1).setHours(23, 59, 00, 00);
                 disable_buttons.push(1); /* Today */
                 disable_buttons.push(2); /* Tomorrow */
             }
-- 
2.30.2