Skip to content

Commit

Permalink
Replaced the year range filter with new attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Nov 5, 2024
1 parent f3e4906 commit d2bea7a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/algolia-search/algolia-search-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const Form = ({searchIndex}: {searchIndex: string}) => {
range: pubYearRangeBounds,
refine: refineRange,
canRefine: canRefinePubYear,
} = useRange({attribute: "book_published"})
} = useRange({attribute: "book_published_year"})
const {min: minYear, max: maxYear} = pubYearRangeBounds
const {items: currentRefinements, canRefine: canRefineCurrent, refine: removeRefinement} = useCurrentRefinements({})

Expand All @@ -88,6 +88,7 @@ const Form = ({searchIndex}: {searchIndex: string}) => {
])

const yearOptions: SelectOptionDefinition<string>[] = []

for (let i = maxYear || new Date().getFullYear(); i >= (minYear || 1990); i--) {
yearOptions.push({value: `${i}`, label: `${i}`})
}
Expand Down

0 comments on commit d2bea7a

Please sign in to comment.