bigbluebutton-Github/bigbluebutton-html5/imports/utils/humanizeSeconds.js

17 lines
276 B
JavaScript
Raw Normal View History

2017-06-03 03:25:02 +08:00
const humanizeSeconds = (time) => {
2016-11-29 03:48:02 +08:00
const minutes = Math.floor(time / 60);
const seconds = time % 60;
return [
minutes,
seconds,
2017-10-06 20:50:01 +08:00
].map((x) => {
if (x < 10) {
return `0${x}`;
}
return x;
},
).join(':');
2016-11-29 03:48:02 +08:00
};
2017-10-24 00:26:56 +08:00
export default humanizeSeconds;