nci/static/js/app/components/common/duration/index.jade

5 lines
225 B
Plaintext
Raw Normal View History

- var sec = Math.round(this.props.duration / 1000);
- var min = sec >= 60 ? Math.round(sec / 60) : 0;
- var suffix = this.props.withSuffix ? 'in ' : '';
span(title= sec + ' sec')= suffix + (min ? min + ' min' : sec + ' sec')