Skip to content
New issue

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

Unable to custom format duration('mm:ss') #112

Open
wwwizzarrdry opened this issue Nov 30, 2018 · 1 comment
Open

Unable to custom format duration('mm:ss') #112

wwwizzarrdry opened this issue Nov 30, 2018 · 1 comment

Comments

@wwwizzarrdry
Copy link

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') }}

@wsitch
Copy link

wsitch commented Feb 14, 2020

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]')
      }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants