From 11e025e40a736fd61ca238ca414995fdf62a809a Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 27 Sep 2024 21:17:49 +0000 Subject: [PATCH] Bug 38027: Set date to empty value instead of using flatpickr clear() 1. Find a datetime field in Koha. For example, specifying due dates on the checkout page. 2. Specify a datetime. 3. Use the red 'X' icon to clear the date. 4. Notice a console error 'parsedDate' is undef 5. Now the flatpickr is date, not datetime 6. APPLY patch 7. Try again, this time no console error and the flatpickr remains a datetime one Signed-off-by: Phil Ringnalda Signed-off-by: Julian Maurice Signed-off-by: Katrin Fischer (cherry picked from commit 4d4337bbedff193da163ef8765330797c43712a2) Signed-off-by: Lucas Gass --- 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 9f1cdb6ceb..95234ba8e3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc @@ -74,7 +74,7 @@ .addClass("clear_date") .on("click", function(e){ e.preventDefault(); - instance.input.flatpickr().clear(); + instance.setDate(''); }) .addClass("fa fa-fw fa-times") .attr("aria-hidden", true)