feat/frontend: display patches in new format
pipeline / lint-and-format (push) Successful in 3m23s
pipeline / build-and-push-images (push) Successful in 1m44s
pipeline / lint-and-publish-chart (push) Successful in 6s

This commit is contained in:
2026-08-22 12:57:20 +02:00
parent fe5569fcd7
commit aff27b9a51
2 changed files with 17 additions and 1 deletions
+13
View File
@@ -100,6 +100,19 @@ export function getRuneImageUrl(runeId: number): string {
return `${CDRAGON_BASE}plugins/rcp-be-lol-game-data/global/default/v1/perks/${runeId}.png`
}
/**
* Format a patch version for display.
* Riot moved from the old "16.6" patch format to "26.6", so 10 is added
* to the major version before showing it to the user.
* @param patch Patch version string (e.g. "16.6")
* @returns Displayable patch version string (e.g. "26.6")
*/
export function displayPatch(patch: string): string {
const match = /^(\d+)(\..*)?$/.exec(patch)
if (!match) return patch
return `${Number(match[1]) + 10}${match[2] ?? ''}`
}
/**
* Format large numbers with abbreviations (K, M)
* @param num Number to format