jsmreese / moment-duration-format

Format function plugin for the Moment Duration object.
MIT License
968 stars 120 forks source link

Trim both #46

Closed grimurd closed 6 years ago

grimurd commented 8 years ago

I want to trim a date from both sides, so that a duration that can range from a minute to a couple of months won't show "0 months 0 days 1 hour 0 minutes 0 seconds" but instead just shows "1 hour"

azizfcb commented 7 years ago

+1 this would be awesome

valesken commented 7 years ago

+1 yes please!

jsmreese commented 6 years ago

Closing this issue since trim: "both" is now available on the master branch.

FYI that I'm working on an updated, more flexible trim API right now. Nothing that already works will break with the new options, but you'll have more trim flexibility.

See my comment here: https://github.com/jsmreese/moment-duration-format/issues/64#issuecomment-349027315