From c5f00c5363c7f33ca1da5664cba0ba6343b67250 Mon Sep 17 00:00:00 2001 From: Bruno Da Silva Date: Fri, 20 Apr 2018 15:06:28 +0000 Subject: [PATCH] bugfix: advanced search - dates "<=" operator handling SVN:trunk[5713] --- .../search_form_criteria_date_abstract.js | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/js/search/search_form_criteria_date_abstract.js b/js/search/search_form_criteria_date_abstract.js index 7365bc934..6e638951d 100644 --- a/js/search/search_form_criteria_date_abstract.js +++ b/js/search/search_form_criteria_date_abstract.js @@ -54,13 +54,29 @@ $(function() ] }, - + + + _create: function() { + var me = this; + + //let's hack the <= operator in order to fall back on the only one that matter here : `between_dates` + if ('<=' == me.options.operator && me.options.values.constructor === Array) + { + me.options.operator = 'between_dates'; + me.options.values.unshift({"label":'', "value":''}); + } + else if ('>=' == me.options.operator) + { + me.options.operator = 'between_dates'; + } + + me._superApply(arguments); + }, - - // Prepare operator's DOM element + // Prepare operator's DOM element _prepareBetweenDaysOperator: function(oOpElem, sOpIdx, oOp) { var me = this;