Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/app/gigs/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ const fetchGigs = async (year: number, tab: string) => {

const numberSuffix = (n: number) => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add support for English number suffixes (i.e. 1st, 2nd, 3rd and so on)?

const lastDigit = n % 10;
return lastDigit === 1 || lastDigit === 2 ? 'a' : 'e';
const secondDigit = (((n % 100) - lastDigit) / 10);
return (lastDigit === 1 || lastDigit === 2) and secondDigit !== 1 ? 'a' : 'e';
Comment on lines +27 to +28
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good change, but I would prefer if we checked something like

const hasSuffixE = [1, 2, 11, 12]
const lastTwoDigits = n % 100;
return hasSuffixE.includes(lastTwoDigits);

as it would be a little more clearer what the intent is.

};

const GigList = async ({ year, tab }: GigListProps) => {
Expand Down