diff --git a/src/lib/util.ts b/src/lib/util.ts index 89ce10e..c6ae0e7 100644 --- a/src/lib/util.ts +++ b/src/lib/util.ts @@ -110,12 +110,12 @@ export const capitalizeFirstLetter = (str: string): string => { }; /** - * prefixZero adds a leading zero to the string if it is less than 10 + * prefixZero adds a leading zero to the string if it is less than 10 and not 0 * @param str The string to prefix * @returns The string with a leading zero if it was only 1 digit long */ export const prefixZero = (str: string): string => { - if (str.length === 1) { + if (str.length === 1 && str !== '0') { return '0' + str; } return str;