Add seconds display in title attribute of total time (#696)
This commit is contained in:
parent
b1ea2c6dc7
commit
a35814b8b3
1 changed files with 3 additions and 0 deletions
|
|
@ -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);
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue