Closed solimant closed 3 years ago
Would the parse-ms
module work for you?
This library is actively maintained but no new features will be added, so I'm going to close this issue, but I'm happy to discuss a fork or help out with another module.
Would the
parse-ms
module work for you?This library is actively maintained but no new features will be added, so I'm going to close this issue, but I'm happy to discuss a fork or help out with another module.
Yes, that works, thank you very much!
🙋 Feature Request
It would be nice if we can have a
humanizeDurationParts
that can return the parts of the computed humanized duration.🤔 Expected Behavior
humanizeDurationParts
would return a shaped representation of the humanized duration. For example, something like:Alternatively, we can discuss what's the best shape to return; for example:
😯 Current Behavior
There is no such API.
💁 Possible Solution
Parse the output string of
humanizeDuration
? But what do you do if the output string is in a different language?🔦 Context
Be able to use this with the
Intl.RelativeTimeFormat
API so that one can be able to pass the correct unit to the API to render something like3 months ago
.💻 Examples
OR