Adjusted
This commit is contained in:
@@ -10,4 +10,16 @@ export function getTimestamp() {
|
||||
const SS = String(now.getSeconds()).padStart(2, "0");
|
||||
|
||||
return `${YYYY}${MM}${DD}_${HH}${mm}${SS}`;
|
||||
}
|
||||
}
|
||||
|
||||
export function formatDuration (secs) {
|
||||
if (!secs) return "0 min";
|
||||
const h = Math.floor(secs / 3600);
|
||||
const m = Math.floor((secs % 3600) / 60);
|
||||
const s = secs % 60;
|
||||
const parts = [];
|
||||
if (h) parts.push(`${h} hr`);
|
||||
if (m) parts.push(`${m} min${m !== 1 ? "s" : ""}`);
|
||||
if (!h && !m && s) parts.push(`${s} sec${s !== 1 ? "s" : ""}`);
|
||||
return parts.join(" ");
|
||||
};
|
||||
Reference in New Issue
Block a user