Skip to content

Commit

Permalink
Display the years in descending order
Browse files Browse the repository at this point in the history
  • Loading branch information
clementprdhomme committed Nov 9, 2023
1 parent 3e80423 commit 68a9d29
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions modules/tool/world-map/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,13 @@ export const selectYearOptions = createSelector([selectContext, selectUnit], (co
return [];
}

const years = context.resizeBy.find(u => u.attributeId === +unit)?.years;

return (
context.resizeBy
.find(u => u.attributeId === +unit)
?.years.map(year => ({
[...(years ?? [])]
.sort()
.reverse()
.map(year => ({
label: `${year}`,
value: `${year}`,
})) ?? []
Expand Down

0 comments on commit 68a9d29

Please sign in to comment.