1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 08:43:27 +00:00

(trunk web) #2966: "Patch: Present time with correct number of digits in the web interface" -- added to trunk for 1.92. thanks to gongloo for the patch.

This commit is contained in:
Charles Kerr 2010-02-24 04:35:51 +00:00
parent 4401dcaa28
commit 7138a3e346

View file

@ -234,8 +234,19 @@ Math.formatTimestamp = function(seconds) {
if(hours == 0){ if(hours == 0){
hours = 12; hours = 12;
} }
if(hours < 10){
hours = "0" + hours;
}
var minutes = myDate.getMinutes();
if(minutes < 10){
minutes = "0" + minutes;
}
var seconds = myDate.getSeconds();
if(seconds < 10){
seconds = "0" + seconds;
}
time = [hours, myDate.getMinutes(), myDate.getSeconds()].join(':'); time = [hours, minutes, seconds].join(':');
return [date, time, period].join(' '); return [date, time, period].join(' ');
}; };