feat: logs history
This commit is contained in:
@@ -344,3 +344,18 @@ export const parseParamsString = (paramsString: string): string[] => {
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
// ordinal.ts
|
||||
const enOrdinalRules = new Intl.PluralRules('en', { type: 'ordinal' });
|
||||
|
||||
const suffixMap: Record<string, string> = {
|
||||
one: 'st',
|
||||
two: 'nd',
|
||||
few: 'rd',
|
||||
other: 'th'
|
||||
};
|
||||
|
||||
export function formatOrdinal(n: number): string {
|
||||
const rule = enOrdinalRules.select(n);
|
||||
return `${n}${suffixMap[rule]}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user