From 1731f8a9b417991df016a2d38cab2808795184df Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 24 Jul 2023 13:12:04 +0200 Subject: [PATCH] Bug 34226: Remove apply_flatpickr It needs more work. The include calendar.inc should not be done in patron-search.inc, and the order of the include (inc+js) is wrong at some point (need more investigation) Also you cannot search for a specific year, you need to enter a valid date --- .../intranet-tmpl/prog/en/includes/patron-search.inc | 1 - koha-tmpl/intranet-tmpl/prog/js/datatables.js | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-) 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 34502bcce73..8f13fa0374e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -242,7 +242,6 @@ [% INCLUDE 'datatables.inc' %] - [% INCLUDE 'calendar.inc' %] [% INCLUDE 'js-patron-get-age.inc' %] [% INCLUDE 'js-patron-format.inc' %] [% INCLUDE 'js-patron-format-address.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js index ed2ceedc8e0..21897a4a90c 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js @@ -586,8 +586,6 @@ function _dt_default_ajax (params){ } else { console.log("datatype %s not supported yet".format(col.datatype)); } - } else if (col.data && ( col.data.endsWith('_on') || col.data.endsWith('_date') ) ) { - is_date_field = true; } if ( is_date_field ) { @@ -900,7 +898,7 @@ function _dt_add_filters(table_node, table_dt, filters_options = {}) { $(this).html( select ); } else if (table_dt.settings()[0].aoColumns[i].sType == 'date' ) { let existing_search = table_dt.column(i).search(); - let input = $(''); + let input = $(''); if (existing_search) { input.prop("value", existing_search); } @@ -936,10 +934,6 @@ function _dt_add_filters(table_node, table_dt, filters_options = {}) { $(this).html(''); } } ); - - $(".flatpickr").each(function(){ - apply_flatpickr(this); - }); } -- 2.25.1