Skip to content

Commit

Permalink
improvement: don't show years in work listing (refs #12)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinstadler committed Jan 17, 2025
1 parent 48ebf6c commit 9782911
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions app/[locale]/works/[category]/[id]/WorksPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,14 @@ export function WorksPage(props: WorksPageProps) {
.filter((item) => {
return item.value in works;
})
.sort((a, b) => {
const ya = works[a.value]!.year;
const yb = works[b.value]!.year;
if (!ya) {
return 1;
} else if (!yb) {
return -1;
} else {
return ya - yb;
}
})
.map((item) => {
const work = works[item.value]!;
item.label = work.short_title ?? work.title;
if (work.year) {
item.label += ` (${work.year.toString()})`;
}
return item;
})
.sort((a, b) => {
return a.label.localeCompare(b.label);
})
);
};

Expand Down

0 comments on commit 9782911

Please sign in to comment.