From 9d6dc8202e3ace47ee8cf1cd9f0cad5093739f3b Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 3 Mar 2023 20:27:33 +0000 Subject: [PATCH] Bug 33132: Fix DOB search for 22.05 To test: 1. Apply patch 2. Search for patrons given their date of birth. You need to select "date of birth" in the "Search field" dropdown, or set it in DefaultPatronSearchFields. 3. Try with all the different dateformat's to make sure it works with each. --- koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc index eb7b6426dd..ba5753e29d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -327,7 +327,7 @@ sub_or.push({["me."+attr]:{"like":(search_type == "contain" ? "%" : "" ) + pattern + "%"}}); if ( attr == 'dateofbirth' ) { try { - let d = $date_to_rfc3339(pattern); + let d = moment(pattern).format("YYYY-MM-DD"); sub_or.push({["me."+attr]:d}); } catch { // Hide the warning if the date is not correct -- 2.30.2