adopted-ember-addons / ember-moment

MIT License
400 stars 122 forks source link

Moment duration don't woks #264

Closed villander closed 6 years ago

villander commented 6 years ago

I wan show my seconds as minutes

https://www.npmjs.com/package/moment-duration-format#basics

moment.duration(123, "minutes").format();
// "2:03:00"

How i do this with ember-moment?

Look my code: {{moment-duration seconds "minutes"}}

If i put 10 seconds, ember-moment showed 10 minutes

When i do this in component.js i have this error: Uncaught TypeError: _moment.default.duration(...).format is not a function,

secondsFormatted: computed('seconds', function() {
    const momentService = this.get('moment');
    return momentService.moment(moment.duration(this.get('seconds', "minutes")).format());
  }),
theswamis commented 5 years ago

What was the solution for this? @villander