Set upper limit key in intervalToDuraition function #2353
Unanswered
shaifulborhan
asked this question in
Q&A
Replies: 1 comment
-
Seems like https://date-fns.org/v2.19.0/docs/formatDistanceStrict might be closer, but I can't find anything like moment's. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using the intervalToDuration() function, the duration results are returned in this format:
Is there a way to set the upper limit key so that the remaining duration value are not calculated beyond that key?
For example, if my duration results is this:
If I set
hours
as the upper limit key, I would expect the results to look like this:Is there a way to accomplish something like this? At the moment I am doing manual calculation to hours if the days, months and years values are present.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions