DurationFormatter

how do i format ms to custom formatted duration? like i want this 5d 21h 45m 12s but not this 5 days 21 hours 45 minutes 12 seconds i use this: new DurationFormatter().format(some duration)
Solution:
ms
Tiny millisecond conversion utility ❯ Author: vercel ❯ Maintainers: gdborton, matheuss, rauchg, matt.straka, nick.tracey, zeit-bot, vercel-release-bot, and leo ❯ Latest version: 2.1.3 ❯ License: MIT ❯ Date Created: <t:1324496288:d> ❯ Date Modified: <t:1707754153:d> Dependencies: No dependencies <:_:637706251253317669>
Jump to solution
6 Replies
Favna
Favna6mo ago
I think you can provide custom token set to the class, I havent used it in a long time. Best shot you got is checking the docs at https://sapphirejs.dev or the code on github.
Sapphire Framework
Home | Sapphire
Sapphire is a next-gen Discord bot framework for developers of all skill levels to make the best JavaScript/TypeScript based bots possible.
Dynamic
DynamicOP6mo ago
there's no other way mentioned in the docs like that, it just have this
No description
Dynamic
DynamicOP6mo ago
i want to do the opposite giving ms which converts it to that string
Solution
Spinel
Spinel6mo ago
ms
Tiny millisecond conversion utility ❯ Author: vercel ❯ Maintainers: gdborton, matheuss, rauchg, matt.straka, nick.tracey, zeit-bot, vercel-release-bot, and leo ❯ Latest version: 2.1.3 ❯ License: MIT ❯ Date Created: <t:1324496288:d> ❯ Date Modified: <t:1707754153:d> Dependencies: No dependencies <:_:637706251253317669>
Favna
Favna6mo ago
use that package
Dynamic
DynamicOP6mo ago
ok thank you
Want results from more Discord servers?
Add your server