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:Jump to 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>
6 Replies
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.
there's no other way mentioned in the docs like that, it just have this
i want to do the opposite
giving ms which converts it to that string
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>
use that package
ok thank you