diff --git a/assets/html/base.html b/assets/html/base.html index d53a5d8..21a4805 100644 --- a/assets/html/base.html +++ b/assets/html/base.html @@ -59,6 +59,18 @@ replaysOnErrorSampleRate: 1.0, }); } + + // Converts milliseconds to an MM:SS string. + function ms_to_mmss(milliseconds) { + const seconds = Math.floor(milliseconds / 1000); + const minutes = Math.floor(seconds / 60); + const remainingSeconds = seconds % 60; + + const formattedMinutes = minutes.toString().padStart(2, "0"); + const formattedSeconds = remainingSeconds.toString().padStart(2, "0"); + + return `${formattedMinutes}:${formattedSeconds}`; + } {% endblock %} @@ -282,6 +287,7 @@