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
intervalToDuration
The intervalToDuration method was changed to remove zeroes.
This change has not yet been reflected in the documentation either.
intervalToDuration({ start: new Date(1929, 0, 15, 12, 0, 0), end: new Date(1968, 3, 4, 19, 5, 0) }) // => { years: 39, months: 2, days: 20, hours: 7, minutes: 5, seconds: 0 }
I would like a way to keep the zeroes, since I'm trying to use intervalToDuration with formatDuration with zero: true.
formatDuration
zero: true
formatDuration( intervalToDuration({ start: 0, end: 432600000 }), // 5 days and 10 minutes { format: ['days', 'hours', 'minutes'], zero: true, locale: { formatDistance: (token, count) => `${count}${token[1].toLowerCase()}` } } ) // Expected -> '5d 0h 10m' // Actual -> '5d 10m
Another option is to have the FormatDurationOptions.zero option to also apply to undefined values.
FormatDurationOptions.zero
undefined
The text was updated successfully, but these errors were encountered:
just saw duplicate #3658
Sorry, something went wrong.
No branches or pull requests
The
intervalToDuration
method was changed to remove zeroes.This change has not yet been reflected in the documentation either.
I would like a way to keep the zeroes, since I'm trying to use
intervalToDuration
withformatDuration
withzero: true
.Another option is to have the
FormatDurationOptions.zero
option to also apply toundefined
values.The text was updated successfully, but these errors were encountered: