Detailed Description:
I'm runnig CMS 1.6.3. and browser is safari 4.
the bug:
If first second ist displayed, then next second is displayed as 11. This take
the time on page in future, that means, when page is refreshed, it jumps back on
real time. I fixed the bug with some changes in Javascript.
Function in version 1.0:
function createTime()
{
var currentHours = currentTime.getHours();
var currentMinutes = currentTime.getMinutes();
var currentSeconds = currentTime.getSeconds();
if (currentHours < 10)
currentHours = "0" + currentHours;
if (currentMinutes < 10)
currentMinutes = "0" + currentMinutes;
if (currentSeconds < 10)
currentSeconds = "0" + currentSeconds;
currentTime.setSeconds( currentSeconds+1 );
document.getElementById("time").innerHTML = currentHours + ":" + currentMinutes
+ ":" + currentSeconds;
window.setTimeout("createTime()", 1000);
}
Repaired:
function createTime()
{
var currentHours = currentTime.getHours();
var currentMinutes = currentTime.getMinutes();
var currentSeconds = currentTime.getSeconds();
var prefixHours = "";
var prefixMinutes = "";
var prefixSeconds = "";
if (currentHours < 10)
prefixHours = "0";
if (currentMinutes < 10)
prefixMinutes = "0";
if (currentSeconds < 10)
prefixSeconds = "0";
currentTime.setSeconds( currentSeconds+1 );
document.getElementById("time").innerHTML = prefixHours + currentHours + ":" +
prefixMinutes + currentMinutes + ":" + prefixSeconds + currentSeconds;
window.setTimeout("createTime()", 1000);
}