15 lines
445 B
JavaScript
15 lines
445 B
JavaScript
import { helper } from '@ember/component/helper';
|
|
|
|
export default helper(function secToTime([sec]) {
|
|
let seconds = parseInt(sec % 60),
|
|
minutes = parseInt((sec / 60) % 60),
|
|
hours = parseInt((sec / (60 * 60)) % 24);
|
|
|
|
hours = (hours < 10) ? "0" + hours : hours;
|
|
minutes = (minutes < 10) ? "0" + minutes : minutes;
|
|
seconds = (seconds < 10) ? "0" + seconds : seconds;
|
|
|
|
return hours + ":" + minutes + ":" + seconds;
|
|
});
|
|
|