From: Bill Erickson Date: Thu, 2 Feb 2017 17:25:01 +0000 (-0500) Subject: JBAS-1705 New headings search excludes 12am next day X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f7dc2c679c9c508424efb332f58c6a74a5ab4eba;p=working%2FEvergreen.git JBAS-1705 New headings search excludes 12am next day Search for headings with dates < end-date + 1 day, instead of <= (or between) so that 12am next day is not included. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/web/js/ui/default/cat/authority/new_headings.js b/Open-ILS/web/js/ui/default/cat/authority/new_headings.js index bb2e18a7a6..b154511f20 100644 --- a/Open-ILS/web/js/ui/default/cat/authority/new_headings.js +++ b/Open-ILS/web/js/ui/default/cat/authority/new_headings.js @@ -166,14 +166,18 @@ function compile_date_filter() { end_date = openils.Util.getYMD(end_date); } - var date_filter = {heading_date : {}}; + var date_filter = {} if (start_date && end_date) { - date_filter.heading_date = {between : [start_date, end_date]} + // use -and instead of BETWEEN so that end_date is not inclusive. + date_filter['-and'] = [ + {heading_date : {'>=' : start_date}}, + {heading_date : {'<' : end_date}} + ]; } else if (start_date) { date_filter.heading_date = {'>=' : start_date}; } else { - date_filter.heading_date = {'<=' : end_date}; + date_filter.heading_date = {'<' : end_date}; } return date_filter;