Closed
Description
Currently testing on version 3, and not sure the best way to display durations. Currently, I have this:
import Component from "@ember/component";
import {computed} from "@ember/object";
export default Component.extend({
entry: null,
duration: computed("entry.startTime", "entry.endTime", function() {
if (this.get("entry.startTime") && this.get("entry.endTime")) {
return this.get("entry.endTime") - this.get("entry.startTime");
}
return 0;
}),
});
Where duration
is a value in milliseconds, so I can do something like:
{{t "entry.duration" duration=entry.duration}}
And the translation is:
entry:
duration: |
{duration,
>60000 {minutes}
>3600000 {hours}
}
What I really want is to use something like format-relative
, but without the "days ago" part. How can I change that functionality, and then pass in a duration
property?
Metadata
Metadata
Assignees
Labels
No labels