MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / formatTime

Function formatTime

assets/js/video.js:57–64  ·  view source on GitHub ↗
(timeInSeconds)

Source from the content-addressed store, hash-verified

55// formatTime takes a time length in seconds and returns the time in
56// minutes and seconds
57function formatTime(timeInSeconds) {
58 const result = new Date(timeInSeconds * 1000).toISOString().substr(11, 8);
59
60 return {
61 minutes: result.substr(3, 2),
62 seconds: result.substr(6, 2),
63 };
64}
65
66// initializeVideo sets the video duration, and maximum value of the
67// progressBar

Callers 3

initializeVideoFunction · 0.85
updateTimeElapsedFunction · 0.85
updateSeekTooltipFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected