We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2b6ea41 commit cb2e5a9Copy full SHA for cb2e5a9
apps/web/lib/fields/misc.tsx
@@ -6,8 +6,8 @@ export function getBuildDateAbbr(date: Date): string {
6
}
7
8
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);
+ if (patch < 0) return "a"; // cap at 'a' for negative patch numbers
+ if (patch > 25) return "z"; // cap at 'z' for patch numbers > 25
+ const charCode = "a".charCodeAt(0) + patch;
12
return String.fromCharCode(charCode); // alphabetic 0-25 to a-z
13
0 commit comments