Skip to content

Commit

Permalink
Sort available years.
Browse files Browse the repository at this point in the history
  • Loading branch information
lublagg committed Oct 4, 2023
1 parent 54f53d6 commit 9b9fe8b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/years-options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export const YearsOptions: React.FC<IProps> = (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));
Expand Down

0 comments on commit 9b9fe8b

Please sign in to comment.