mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
calculate playlist duration
- use python's `sum()` method to add durations instead of for loop
This commit is contained in:
committed by
Mungai Geoffrey
parent
5bc0eaf8e6
commit
b318c0d324
@@ -37,9 +37,12 @@ function getElem(id: string, type: string) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts seconds into minutes and hours.
|
||||
* @param seconds The seconds to convert
|
||||
* @param long Whether to provide the time in the long format
|
||||
*/
|
||||
function formatSeconds(seconds: number, long?: boolean) {
|
||||
// check if there are arguments
|
||||
|
||||
const date = new Date(seconds * 1000);
|
||||
|
||||
const hh = date.getUTCHours();
|
||||
|
||||
Reference in New Issue
Block a user