diff --git a/app/assets/search.mjs b/app/assets/search.mjs index 62c6262e9..8747d185c 100644 --- a/app/assets/search.mjs +++ b/app/assets/search.mjs @@ -407,7 +407,7 @@ createApp({ }, isFacetExpanded(facetKey) { let settings = this.getFacetSettings(facetKey) - return !!settings.expanded + return !!settings.expanded || this.getSelectedOptionsCount(facetKey) }, isFacetSortedBy(facetKey, sort, order) { let settings = this.getFacetSettings(facetKey) @@ -418,7 +418,16 @@ createApp({ return this.getSelectedOptions(facetKey).length }, getSelectedOptions(facetKey) { - return this.selection?.facets[facetKey] || [] + let ret = this.selection?.facets[facetKey] || [] + if (facetKey == 'dat') { + if (this.selection.dateFrom > DATE_MIN) { + ret.push(this.selection.dateFrom) + } + if (this.selection.dateTo < DATE_MAX) { + ret.push(this.selection.dateTo) + } + } + return ret }, onClickFacetColumn(facetKey, columnName) { let settings = this.getFacetSettings(facetKey) diff --git a/app/search.html b/app/search.html index 2d2c200e5..a4034b752 100644 --- a/app/search.html +++ b/app/search.html @@ -110,9 +110,14 @@
- Date Range + + + + Date Range + ({{getSelectedOptionsCount('dat')}}) +
-