diff --git a/lib/AcqList/utils/queryUtils.js b/lib/AcqList/utils/queryUtils.js index add04626..86e58046 100644 --- a/lib/AcqList/utils/queryUtils.js +++ b/lib/AcqList/utils/queryUtils.js @@ -31,7 +31,7 @@ export const buildArrayFieldQuery = (filterKey, filterValue) => { }; export const buildDateRangeQuery = (filterKey, filterValue) => { - const [from, to] = filterValue.split(':'); + const [from, to] = (Array.isArray(filterValue) ? filterValue.toString() : filterValue).split(':'); const start = moment(from).startOf('day').format(DATE_RANGE_FILTER_FORMAT); const end = moment(to).endOf('day').format(DATE_RANGE_FILTER_FORMAT); @@ -47,7 +47,7 @@ export const buildNumberRangeQuery = (filterKey, filterValue) => { }; export const buildDateTimeRangeQuery = (filterKey, filterValue) => { - const [from, to] = filterValue.split(':'); + const [from, to] = (Array.isArray(filterValue) ? filterValue.toString() : filterValue).split(':'); const start = moment(from).startOf('day').utc().format(DATE_RANGE_FILTER_FORMAT); const end = moment(to).endOf('day').utc().format(DATE_RANGE_FILTER_FORMAT);