I'm having a weird problem, hopefully somebody could help me out.
I'm using the striped lockscreen on my springboard. From 1 to 9 AM my clock reads like 01:30. But in the afternoon and evening it reads as 1:30. I have it set to 12 hour, but I would like for it to read like 01:30 so the clock placement will stay even on the springboard at all times. I have no clue how to fix this.
Here's an example.
Image
Image
I've tried messing around with it, editing stuff, but I can't figure out why it's doing this.
In the LockBackground.html file, replace the function updateClock clock with this code:
function updateClock ( )
{
var currentHours_name_array = new Array ("00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "00")
var currentMinutes_name_array = new Array ("00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28","29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "00")
var currentTime = new Date ( );
var currentHours = currentTime.getHours ( );
var currentMinutes = currentTime.getMinutes ( );
var currentSeconds = currentTime.getSeconds ( );
// Convert an hours component of "0" to "12"
// currentHours = ( currentHours == 0 ) ? currentHours + 24 : currentHours;
// Convert the hours component to 12-hour format if needed
currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;
// Convert an hours component of "0" to "12"
currentHours = ( currentHours == 0 ) ? 12 : currentHours;
// Compose the string for display
var currentTimeString = currentHours_name_array[currentHours] + ":" + currentMinutes_name_array[currentMinutes];
// Update the time display
document.getElementById("clock").firstChild.nodeValue = currentTimeString;
// Pad the minutes and seconds with leading zeros, if required
currentHours = ( currentHours < 10 ? "0" : "" ) + currentHours;
currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;
}