summaryrefslogtreecommitdiff
path: root/src/utils/strings.ts
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-04-13 22:15:25 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-04-13 22:15:25 +1000
commit17bee0e3854163c9ce142b502d8dad30caa52c5d (patch)
treee8e34d1335fddcd66a196b84ef71bc64fc7a8480 /src/utils/strings.ts
parentnavbar: config show labels (diff)
downloadcaelestia-shell-17bee0e3854163c9ce142b502d8dad30caa52c5d.tar.gz
caelestia-shell-17bee0e3854163c9ce142b502d8dad30caa52c5d.tar.bz2
caelestia-shell-17bee0e3854163c9ce142b502d8dad30caa52c5d.zip
feat: add music visualiser
Diffstat (limited to 'src/utils/strings.ts')
-rw-r--r--src/utils/strings.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/utils/strings.ts b/src/utils/strings.ts
index 77608e8..1edad67 100644
--- a/src/utils/strings.ts
+++ b/src/utils/strings.ts
@@ -11,3 +11,8 @@ export const pathToFileName = (path: string, ext?: string) => {
};
export const capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);
+
+export const lengthStr = (length: number) =>
+ `${Math.floor(length / 60)}:${Math.floor(length % 60)
+ .toString()
+ .padStart(2, "0")}`;