diff --git a/src/components/years-options.tsx b/src/components/years-options.tsx index 16e519e..1b9ec6f 100644 --- a/src/components/years-options.tsx +++ b/src/components/years-options.tsx @@ -38,7 +38,8 @@ export const YearsOptions: React.FC = (props) => { return years; }, new Set()); const newSet: string[] = Array.from(newAvailableYears); - setAvailableYearOptions(newSet); + const sorted = newSet.sort().reverse(); + setAvailableYearOptions(sorted); // if selected years includes years not in available options, remove them from selection const selectionsNotAvailable = selectedOptions.years.filter(year => !newSet.includes(year));