All checks were successful
Queue Release Build / prepare (push) Successful in 23s
Deploy Web Apps / deploy (push) Successful in 5m54s
Queue Release Build / build-windows (push) Successful in 16m19s
Queue Release Build / build-linux (push) Successful in 30m13s
Queue Release Build / finalize (push) Successful in 47s
15 lines
440 B
TypeScript
15 lines
440 B
TypeScript
export function formatGameActivityElapsed(startedAt: number, now = Date.now()): string {
|
|
const elapsedSeconds = Math.max(0, Math.floor((now - startedAt) / 1000));
|
|
const hours = Math.floor(elapsedSeconds / 3600);
|
|
const minutes = Math.floor((elapsedSeconds % 3600) / 60);
|
|
const seconds = elapsedSeconds % 60;
|
|
|
|
return [
|
|
hours,
|
|
minutes,
|
|
seconds
|
|
]
|
|
.map((value) => value.toString().padStart(2, '0'))
|
|
.join(':');
|
|
}
|