From a35814b8b3360b4f48d5998b42cb5b61251e77b0 Mon Sep 17 00:00:00 2001 From: quaelnix <122357328+quaelnix@users.noreply.github.com> Date: Thu, 16 Feb 2023 18:44:05 +0100 Subject: [PATCH] Add seconds display in title attribute of total time (#696) --- js/control/TrackStats.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/control/TrackStats.js b/js/control/TrackStats.js index fa51d84..9fbfb6a 100644 --- a/js/control/TrackStats.js +++ b/js/control/TrackStats.js @@ -24,6 +24,7 @@ BR.TrackStats = L.Class.extend({ : '0', formattedTime = Math.trunc(stats.totalTime / 3600) + ':' + ('0' + Math.trunc((stats.totalTime % 3600) / 60)).slice(-2), + formattedTimeHMS = formattedTime + ':' + ('0' + Math.trunc(stats.totalTime % 60)).slice(-2), formattedEnergy = L.Util.formatNum(stats.totalEnergy / 3600000, 2).toLocaleString(), meanEnergy = stats.trackLength ? L.Util.formatNum(stats.totalEnergy / 36 / stats.trackLength, 2).toLocaleString() @@ -37,6 +38,8 @@ BR.TrackStats = L.Class.extend({ $('#cost').html(formattedCost); $('#meancostfactor').html(meanCostFactor); $('#totaltime').html(formattedTime); + // alternative time format with seconds display as tooltip + $('#totaltime').attr('title', formattedTimeHMS + ' h'); $('#totalenergy').html(formattedEnergy); $('#meanenergy').html(meanEnergy); },