cyp/app/js/lib/format.js
Ondrej Zara 37fdd5413c styling
2019-03-22 16:17:10 +01:00

13 lines
310 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

export function time(sec) {
sec = Math.round(sec);
let m = Math.floor(sec / 60);
let s = sec % 60;
return `${m}:${s.toString().padStart(2, "0")}`;
}
export function artistAlbum(artist, album) {
let tokens = [];
artist && tokens.push(artist);
album && tokens.push(album);
return tokens.join(" ");
}