feat: logs history

This commit is contained in:
jialin
2026-04-28 14:41:36 +08:00
committed by jialin
parent 0ffc2ee924
commit 0cb260f854
12 changed files with 655 additions and 25 deletions
+15
View File
@@ -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]}`;
}