vue-moment
vue-moment copied to clipboard
Unable to custom format duration('mm:ss')
Nice port, but the duration method needs to accept a custom format string.
I.E. {{ 3600000 | duration('hh:mm:ss') }}
Or allow chaining duration back into moment,
{{ 3600000 | duration() | moment('hh:mm:ss') }}
Agree! A workaround to go from milliseconds or seconds to a formatted string is to use a method as follows:
methods: {
durationDisplay: function(sec) {
return this.$moment.utc(sec * 1000).format('h[h] m[m] s[s]')
}
}