bigbluebutton-Github/bigbluebutton-html5/imports/utils/humanizeSeconds.js
2017-10-23 14:26:56 -02:00

17 lines
276 B
JavaScript

const humanizeSeconds = (time) => {
const minutes = Math.floor(time / 60);
const seconds = time % 60;
return [
minutes,
seconds,
].map((x) => {
if (x < 10) {
return `0${x}`;
}
return x;
},
).join(':');
};
export default humanizeSeconds;