We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi there.
I'm trying to implement localization for durations in the format: 0d 0h 0m 0s whenever I pass in x-amount of seconds.
0d 0h 0m 0s
I currently just have a function like this, and it works fine for english, but the units are not localized.
formatSeconds(seconds: number) { return dayjs.duration(seconds, 'seconds').format('D[d] H[h] M[m] s[s]'); }
I thought I could change this behaviour by using the updateLocale plugin, but it doesn't seem like it from the documentation (I might be wrong).
updateLocale
Is it possible to implement localization for this with the dayjs library as of now, or do I have to implement something custom myself?
Thanks in advance
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi there.
I'm trying to implement localization for durations in the format:
0d 0h 0m 0s
whenever I pass in x-amount of seconds.I currently just have a function like this, and it works fine for english, but the units are not localized.
I thought I could change this behaviour by using the
updateLocale
plugin, but it doesn't seem like it from the documentation (I might be wrong).Is it possible to implement localization for this with the dayjs library as of now, or do I have to implement something custom myself?
Thanks in advance
The text was updated successfully, but these errors were encountered: