Skip to content

Commit cb2e5a9

Browse files
committed
fix: do not wrap patch number
1 parent 2b6ea41 commit cb2e5a9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

apps/web/lib/fields/misc.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ export function getBuildDateAbbr(date: Date): string {
66
}
77

88
export function getPatchAbbr(patch: number): string {
9-
if (patch < 0) return "a"; // handle negative patch numbers
10-
if (patch > 25) patch = patch % 26; // wrap around for patch numbers > 25
11-
const charCode = "a".charCodeAt(0) + (patch % 26);
9+
if (patch < 0) return "a"; // cap at 'a' for negative patch numbers
10+
if (patch > 25) return "z"; // cap at 'z' for patch numbers > 25
11+
const charCode = "a".charCodeAt(0) + patch;
1212
return String.fromCharCode(charCode); // alphabetic 0-25 to a-z
1313
}

0 commit comments

Comments
 (0)