Skip to content

Commit f1a07df

Browse files
authored
Changed hearing sort (#2026)
* Changed hearing search filters * Readded Next Hearing Date (Used in bills sort)
1 parent efa851d commit f1a07df

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

components/search/hearings/HearingSearch.tsx

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,18 @@ const useHearingSort = () => {
3737
return useMemo(
3838
() => [
3939
{
40-
labelKey: "sort_by.newest",
41-
value: "hearings/sort/startsAt:desc"
40+
labelKey: "sort_by.past_newest",
41+
value: "hearings/sort/startsAt:desc",
42+
configure: {
43+
numericRefinements: {
44+
startsAt: {
45+
"<=": [now.current]
46+
}
47+
}
48+
}
4249
},
4350
{
44-
labelKey: "sort_by.next_hearing_date",
51+
labelKey: "sort_by.upcoming",
4552
value: "hearings/sort/startsAt:asc",
4653
configure: {
4754
numericRefinements: {
@@ -52,8 +59,15 @@ const useHearingSort = () => {
5259
}
5360
},
5461
{
55-
labelKey: "sort_by.relevance",
56-
value: "hearings/sort/_text_match:desc,startsAt:asc"
62+
labelKey: "sort_by.past_oldest",
63+
value: "hearings/sort/startsAt:asc,startsAt:asc",
64+
configure: {
65+
numericRefinements: {
66+
startsAt: {
67+
"<=": [now.current]
68+
}
69+
}
70+
}
5771
}
5872
],
5973
[]

public/locales/en/search.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@
3434
"relevance": "Sort by Relevance",
3535
"testimony_count": "Sort by Testimony Count",
3636
"cosponsor_count": "Sort by Cosponsor Count",
37-
"next_hearing_date": "Sort by Next Hearing Date"
37+
"next_hearing_date": "Sort by Next Hearing Date",
38+
"past_newest": "Past (Most recent first)",
39+
"past_oldest": "Past (Oldest First)",
40+
"upcoming": "Upcoming"
3841
},
3942
"result_count": "Showing {{pageStart}}-{{pageEnd}} of {{nbHits}} Results",
4043
"search_box": {

0 commit comments

Comments
 (0)