MCPcopy Create free account
hub / github.com/Tong89/smartNode / formatTime

Function formatTime

frontend/tests/app.unit.test.js:51–57  ·  view source on GitHub ↗

* Format simulation seconds to "HH:MM:SS". * Mirrors app.js `methods.formatTime`.

(seconds)

Source from the content-addressed store, hash-verified

49 * Mirrors app.js `methods.formatTime`.
50 */
51function formatTime(seconds) {
52 const total = Math.max(0, Math.floor(Number(seconds || 0)));
53 const hours = Math.floor(total / 3600);
54 const minutes = Math.floor((total % 3600) / 60);
55 const secs = total % 60;
56 return [hours, minutes, secs].map((part) => String(part).padStart(2, '0')).join(':');
57}
58
59/**
60 * Build utilization row array from resource_status.summary.

Callers 1

app.unit.test.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected