MCPcopy Create free account
hub / github.com/bywwcnll/StreamPanel / formatDuration

Function formatDuration

devtools/modules/utils.js:103–115  ·  view source on GitHub ↗
(ms)

Source from the content-addressed store, hash-verified

101}
102
103export function formatDuration(ms) {
104 const seconds = Math.floor(ms / 1000);
105 const minutes = Math.floor(seconds / 60);
106 const hours = Math.floor(minutes / 60);
107
108 if (hours > 0) {
109 return `${hours}h ${minutes % 60}m`;
110 } else if (minutes > 0) {
111 return `${minutes}m ${seconds % 60}s`;
112 } else {
113 return `${seconds}s`;
114 }
115}
116
117export function getStatusText(status) {
118 const statusMap = {

Callers 1

showStatisticsModalFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected