-
10-13-2008, 09:31 AM #1
Help me fix my Wallpaper.html date code to automatically update on a new day
My date, for my theme, does not update automatically once the time switches from 11:59pm to 12:00am - in other words it doesn't change the date when hitting midnight. It only updates after reboot\respring.
Heres the Wallpaper.html code:
HTML pastebin - collaborative debugging tool
any ideas?Last edited by ranova; 10-13-2008 at 10:04 AM.
-
10-13-2008, 11:15 AM #2
+1 on this. Is this happening to everyone (date not changing over at midnight), or on certain HTML codes?
Last edited by johnny69blaze; 10-13-2008 at 11:16 AM. Reason: spelled midnight wrong
-
10-13-2008, 02:29 PM #3
I saw this bug last week, and made a quick fix today. Havent been able to see if it works yet, but from the way the code is built it should work based on the fact it even displays the date.
It's not the most efficent way to find the date, but it works
Here is a patched version of your code:
(I didnt clean up all the junk left over in there, just really added in my own code.
Code:<html> <head><title>newclock</title> <base href="Private/"/> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <style> body { margin: 0; padding: 20px 0 0 0; height: 480px; width: 320px; } </style> <script type="text/javascript" src="configureMe.js"/> <script type="text/javascript" src="Wallpaper.js"/> </head> <style> SPAN#clock { font-family: Helvetica; color: #ffffff; font-size: 30px; } SPAN#ampm { font-family: Helvetica; color: #ffffff; font-size: 15px; } SPAN#calendar { font-family: Helvetica; text-align: center; color: #ffffff; font-size: 16px; } </style> <script type="text/javascript"> function init ( ) { timeDisplay = document.createTextNode ( "" ); document.getElementById("clock").appendChild ( timeDisplay ); } function updateClock ( ) { var currentTime = new Date ( ); var currentHours = currentTime.getHours ( ); var currentMinutes = currentTime.getMinutes ( ); var currentSeconds = currentTime.getSeconds ( ); // Pad the minutes and seconds with leading zeros, if required currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes; currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds; // Choose either "AM" or "PM" as appropriate var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM"; // 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 + ":" + currentMinutes; // Update the time display document.getElementById("clock").firstChild.nodeValue = currentTimeString; } function init2 ( ) { timeDisplay = document.createTextNode ( "" ); document.getElementById("ampm").appendChild ( timeDisplay ); } function amPm ( ) { var currentTime = new Date ( ); var currentHours = currentTime.getHours ( ); // Choose either "AM" or "PM" as appropriate var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM"; // 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 = timeOfDay; // Update the time display document.getElementById("ampm").firstChild.nodeValue = currentTimeString; } function init3 ( ) { timeDisplay = document.createTextNode ( "" ); document.getElementById("calendar").appendChild ( timeDisplay ); } function calendarDate ( ) { var this_weekday_name_array = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday") var this_month_name_array = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec") //predefine month names var this_date_timestamp = new Date() var this_weekday = this_date_timestamp.getDay() var this_date = this_date_timestamp.getDate() var this_month = this_date_timestamp.getMonth() document.getElementById("calendar").firstChild.nodeValue = this_weekday_name_array[this_weekday] + ", " + this_month_name_array[this_month] + " " + this_date //concat long date string } </script> </head> <body background="Wallpaper.png"> <table style="position: absolute; top: 19px; left: 0px; width: 320px; height: 461px;" cellspacing="0" cellpadding="0" align="center"> <tr align="center" valign="top" border="0" cellpadding="0"> <td height="10" valign="top"> <span id="clock"> <script language="JavaScript">updateClock(); setInterval('updateClock()', 1000 )</script></span><span id="ampm"> <script language="JavaScript">amPm(); setInterval('amPm()', 1000 )</script> </span> </td> </tr> <tr> <td align="center" valign="top"> <span id="calendar"> <script language="JavaScript">calendarDate(); setInterval('calendarDate()', 1000 )</script> </span> </td> </tr> </table> <body onload="onLoad()"> <div id="WeatherContainer"> <div id="TextContainer"> <p id="city">Loading...</p> <p id="temp">-ΒΊ</p> <p id="desc">-</p> </div> <img id="weatherIcon" src=""/> </div> </body> </html>
-
-
10-13-2008, 02:58 PM #4
My god it worked! Thank very much! I used the code you posted, but it's not the setup I want. Can you please fix mine? I would really appreciate it and you'll definitely get thanked
Code:<html> <head><title>newclock</title></head> <style> SPAN#clock { font-family: Helvetica; color: white; font-size: 30px; text-shadow: #000000 1px 2px 1px; } SPAN#ampm { font-family: Helvetica; color: #ffffff; font-size: 18px; text-shadow: #000000 1px 2px 1px; } TD#date { font-family: Helvetica; text-align: center; color: #ffffff; text-shadow: #000000 1px 2px 1px; } </style> <script type="text/javascript"> <!-- var this_weekday_name_array = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday") var this_month_name_array = new Array("January","February","March","April","May","June","July","August","September","October","November","December") //predefine month names var this_date_timestamp = new Date() var this_weekday = this_date_timestamp.getDay() var this_date = this_date_timestamp.getDate() var this_month = this_date_timestamp.getMonth() var this_year = this_date_timestamp.getYear() if (this_year < 1000) this_year+= 1900; if (this_year==101) this_year=2001; var this_date_string = this_weekday_name_array[this_weekday] + ", " + this_month_name_array[this_month] + " " + this_date //concat long date string // --> function init ( ) { timeDisplay = document.createTextNode ( "" ); document.getElementById("clock").appendChild ( timeDisplay ); } function updateClock ( ) { var currentTime = new Date ( ); var currentHours = currentTime.getHours ( ); var currentMinutes = currentTime.getMinutes ( ); var currentSeconds = currentTime.getSeconds ( ); // Pad the minutes and seconds with leading zeros, if required currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes; currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds; // Choose either "AM" or "PM" as appropriate var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM"; // 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 + ":" + currentMinutes; // Update the time display document.getElementById("clock").firstChild.nodeValue = currentTimeString; } function init2 ( ) { timeDisplay = document.createTextNode ( "" ); document.getElementById("ampm").appendChild ( timeDisplay ); } function amPm ( ) { var currentTime = new Date ( ); var currentHours = currentTime.getHours ( ); // Choose either "AM" or "PM" as appropriate var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM"; // 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 = timeOfDay; // Update the time display document.getElementById("ampm").firstChild.nodeValue = currentTimeString; } // --> </script> </head> <body bgcolor="black" background="Wallpaper.png"> <table style="position: absolute; top: 28px; left: 0px; width: 320px; height: 461px;" cellspacing="0" cellpadding="0" align="center"> <tr align="center" valign="top" border="0" cellpadding="0"> <td height="10" valign="top"> <span id="clock"> <script language="JavaScript">updateClock(); setInterval('updateClock()', 1000 )</script></span><span id="ampm"> <script language="JavaScript">amPm(); setInterval('amPm()', 1000 )</script> </span> </td> </tr> <tr> <td id="date" valign="top"> <script language="JavaScript">document.write(this_date_string)</script> </td> </tr> </table> </body> </html>
-
10-13-2008, 03:11 PM #5
Ok, here ya go.
Note anyone using this wallpaper template has this bug, really all that needs to be done is to set up the date to be on an update counter like the time and AM/PM functions. Pretty simple fix.
Code:<html> <head><title>newclock</title></head> <style> SPAN#clock { font-family: Helvetica; color: white; font-size: 30px; text-shadow: #000000 1px 2px 1px; } SPAN#ampm { font-family: Helvetica; color: #ffffff; font-size: 18px; text-shadow: #000000 1px 2px 1px; } SPAN#calendar { font-family: Helvetica; text-align: center; color: #ffffff; text-shadow: #000000 1px 2px 1px; } </style> <script type="text/javascript"> function init ( ) { timeDisplay = document.createTextNode ( "" ); document.getElementById("clock").appendChild ( timeDisplay ); } function updateClock ( ) { var currentTime = new Date ( ); var currentHours = currentTime.getHours ( ); var currentMinutes = currentTime.getMinutes ( ); var currentSeconds = currentTime.getSeconds ( ); // Pad the minutes and seconds with leading zeros, if required currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes; currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds; // Choose either "AM" or "PM" as appropriate var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM"; // 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 + ":" + currentMinutes; // Update the time display document.getElementById("clock").firstChild.nodeValue = currentTimeString; } function init2 ( ) { timeDisplay = document.createTextNode ( "" ); document.getElementById("ampm").appendChild ( timeDisplay ); } function amPm ( ) { var currentTime = new Date ( ); var currentHours = currentTime.getHours ( ); // Choose either "AM" or "PM" as appropriate var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM"; // 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 = timeOfDay; // Update the time display document.getElementById("ampm").firstChild.nodeValue = currentTimeString; } function init3 ( ) { timeDisplay = document.createTextNode ( "" ); document.getElementById("calendar").appendChild ( timeDisplay ); } function calendarDate ( ) { var this_weekday_name_array = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday") var this_month_name_array = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec") //predefine month names var this_date_timestamp = new Date() var this_weekday = this_date_timestamp.getDay() var this_date = this_date_timestamp.getDate() var this_month = this_date_timestamp.getMonth() document.getElementById("calendar").firstChild.nodeValue = this_weekday_name_array[this_weekday] + ", " + this_month_name_array[this_month] + " " + this_date //concat long date string } </script> </head> <body bgcolor="black" background="Wallpaper.png"> <table style="position: absolute; top: 28px; left: 0px; width: 320px; height: 461px;" cellspacing="0" cellpadding="0" align="center"> <tr align="center" valign="top" border="0" cellpadding="0"> <td height="10" valign="top"> <span id="clock"> <script language="JavaScript">updateClock(); setInterval('updateClock()', 1000 )</script></span><span id="ampm"> <script language="JavaScript">amPm(); setInterval('amPm()', 1000 )</script> </span> </td> </tr> <tr> <td align="center" valign="top"> <span id="calendar"> <script language="JavaScript">calendarDate(); setInterval('calendarDate()', 1000 )</script> </span> </td> </tr> </table> </body> </html>
-
The Following 4 Users Say Thank You to DermicSavage For This Useful Post:
96hondaex (10-14-2008), Ice9812 (10-13-2008), johnny69blaze (10-13-2008), ranova (10-13-2008)
-
10-13-2008, 03:22 PM #6
You are the man! Works like a champ! I appreciate you taking the time and you've been thanked bro!
-
10-13-2008, 04:22 PM #7
thank you very much dermic!

Dermic, quick question. So the update interval for the Date is every second (1000 ms). Does having the date on an interval drain more battery than what it would before? Would it be ok if I updated it to 1800000 milliseconds (30 minutes)?
Thanks againLast edited by ranova; 10-13-2008 at 04:27 PM. Reason: Automerged Doublepost
-
10-13-2008, 04:33 PM #8
I'm not so sure about that.
This is really my first experiment with javascript.
You can modify it to work however you want, I'm just fixing little things. Just note if you change it to update at 30 min intervals, it could have a 30 min delay at updating the date(which aint that big a deal really)
I'm waiting to mess with this a little more to consolidate some of the functionality. This was just a rough cut.
-
The Following 2 Users Say Thank You to DermicSavage For This Useful Post:
96hondaex (10-15-2008), johnny69blaze (10-15-2008)
-
10-15-2008, 08:01 PM #9
I tried to use the code you first posted and for some reason it doesn't work. No time, no date, no weather. If I used the 2nd code you posted, then time and date show up no problem. But I would like the weather to show up. Any ideas? Here is the code I was hoping to use that weather works but the date doesn't refresh correctly. Thanks.
<html>
<head><title>newclock</title>
<base href="./"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style>
body {
margin: 0;
padding: 50px 0 0 0;
height: 480px;
width: 320px;
}
</style>
<script type="text/javascript" src="../configureMe.js">
<script type="text/javascript" src="Wallpaper.js"/>
</head>
<style>
SPAN#clock
{
font-family: Helvetica;
color: #ffffff;
font-size: 50px;
}
SPAN#ampm
{
font-family: Helvetica;
color: #ffffff;
font-size: 15px;
}
TD#date
{
font-family: Helvetica;
text-align: center;
color: #ffffff;
}
</style>
<script type="text/javascript">
<!--
var this_weekday_name_array = new Array("Sunday","Monday","Tuesday","Wednesday","Thu rsday","Friday","Saturday")
var this_month_name_array = new Array("January","February","March","April","May"," June","July","August","September","October","Novem ber","December") //predefine month names
var this_date_timestamp = new Date()
var this_weekday = this_date_timestamp.getDay()
var this_date = this_date_timestamp.getDate()
var this_month = this_date_timestamp.getMonth()
var this_year = this_date_timestamp.getYear()
if (this_year < 1000)
this_year+= 1900;
if (this_year==101)
this_year=2001;
var this_date_string = this_weekday_name_array[this_weekday] + ", " + this_month_name_array[this_month] + " " + this_date //concat long date string
// -->
function init ( )
{
timeDisplay = document.createTextNode ( "" );
document.getElementById("clock").appendChild ( timeDisplay );
}
function updateClock ( )
{
var currentTime = new Date ( );
var currentHours = currentTime.getHours ( );
var currentMinutes = currentTime.getMinutes ( );
var currentSeconds = currentTime.getSeconds ( );
// Pad the minutes and seconds with leading zeros, if required
currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;
// Choose either "AM" or "PM" as appropriate
var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";
// 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 + ":" + currentMinutes;
// Update the time display
document.getElementById("clock").firstChild.nodeVa lue = currentTimeString;
}
function init2 ( )
{
timeDisplay = document.createTextNode ( "" );
document.getElementById("ampm").appendChild ( timeDisplay );
}
function amPm ( )
{
var currentTime = new Date ( );
var currentHours = currentTime.getHours ( );
// Choose either "AM" or "PM" as appropriate
var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";
// 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 = timeOfDay;
// Update the time display
document.getElementById("ampm").firstChild.nodeVal ue = currentTimeString;
}
// -->
</script>
</head>
<body background="../Wallpaper.png">
<table style="position: absolute; top: 19px; left: 0px; width: 320px; height: 461px;" cellspacing="0" cellpadding="0" align="center">
<tr align="center" valign="top" border="0" cellpadding="0">
<td height="10" valign="top">
<span id="clock">
<script language="JavaScript">updateClock(); setInterval('updateClock()', 1000 )</script></span><span id="ampm">
<script language="JavaScript">amPm(); setInterval('amPm()', 1000 )</script>
</span>
</td>
</tr>
<tr>
<td id="date" valign="top">
<script language="JavaScript">document.write(this_date_str ing)</script>
</td>
</tr>
</table>
<body onload="onLoad()">
<div id="WeatherContainer">
<div id="TextContainerLeft"><p id="city">Loading...</p><p id="temp">-?</p></div>
<div id="IconContainerCenter"><img id="weatherIcon" src=""/></div>
<div id="TextContainerRight"><p id="desc">-</p></div>
</div>
</body>
</html>
-
10-15-2008, 08:25 PM #10My iPhone is a Part of Me
- Join Date
- May 2008
- Location
- Scranton
- Posts
- 584
- Thanks
- 164
- Thanked 197 Times in 155 Posts
im not sure but i copied the second code and it works fine....the code you posted is not the same code in dermicsavage post try the code from dermicsavage post and it works ....
from your code it looks like you missing the update interval for your date...i could be wrong i dont write code but from looking the the two here is what i think your missing ...it might work
your code:
TD#date
{
font-family: Helvetica;
text-align: center;
color: #ffffff;
}
<td id="date" valign="top">
<script language="JavaScript">document.write(this_date_str ing)</script>
new code:
SPAN#calendar
{
font-family: Helvetica;
text-align: center;
color: #ffffff;
}
<td align="center" valign="top">
<span id="calendar">
<script language="JavaScript">calendarDate(); setInterval('calendarDate()', 1000 )</script>
find thos two sections in you code and replace them with the bottom ones there in 2 different spots...let me knowLast edited by Ice9812; 10-15-2008 at 08:44 PM.
If I Helped You Hit The Thanks Button
-
10-15-2008, 11:02 PM #11
thanks for the help...I got it working by removing the ../ in front of some of the file locations. But not sure about the date working or not. I will have to see tmw if it refreshes. I hope so...
-
01-31-2009, 09:07 PM #12
Hey I was wondering, if I have some fonts that are already ported for the iphone, is it possible to change the font-family: Helvetica to something else? I want to change the font of the clock and the date only, not the entire system font so I don;t want to have a different Helvetica font.
I tried using this ggraffiti type, I used fontlab to change all the names, wherever it said Helvetica i changed it to graffiti, saved it, put it in the fonts/cache folder and changed the Helvetica in the html to graffiti and it didnt work, it used some default font or something but the graffiti one didnt work.
This font will work however if it's named Helvetica, but it changes the entire system font, which isn;t what Im trying to acheive.
Anybody know how I could do this?
-
01-19-2010, 12:38 PM #13Green Apple
- Join Date
- Aug 2009
- Location
- New York, New York, United States
- Posts
- 41
- Thanks
- 2
- Thanked 0 Times in 0 Posts
can someone please help me update my script to automatically update the date? thanks
<?xml version="1.0" encoding="UTF-8"?>
<html><head>
<base href="Private/"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="configureMe.js"/>
<script type="text/javascript" src="Wallpaper.js"/>
<style>
body {
background-color: none;
margin: 310px 0 0 25px;
padding: 0px 0 0 0;
height: 480px;
width: 320px;
}
SPAN#clock
{
font-family: georgia;
color: transparent;
font-size: 30px;
}
SPAN#ampm
{
font-family: georgia;
color: white;
font-size: 15px;
}
TD#date
{
font-family: georgia;
text-align: center;
color: white; text-shadow: black 1px 2px 3px;
}
</style>
<script type="text/javascript">
<!--
var this_weekday_name_array = new Array("Sun,","Mon,","Tue,","Wed,","Thu,","Fri,","S at,")
var this_month_name_array = new Array("Jan","Feb","Mar","Apr","May","Jun","July"," Aug","Sept","Oct","Nov","Dec") //predefine month names
var this_date_timestamp = new Date()
var this_weekday = this_date_timestamp.getDay()
var this_date = this_date_timestamp.getDate()
var this_month = this_date_timestamp.getMonth()
var this_year = this_date_timestamp.getYear()
if (this_year < 1000)
this_year+= 1900;
if (this_year==101)
this_year=2001;
var this_date_string = this_weekday_name_array[this_weekday] + " " + this_date + " " + this_month_name_array[this_month]//concat long date string
// -->
<!--
var this_weekday_name_array = new Array("Sun,","Mon,","Tue,","Wed,","Thu,","Fri,","S at,")
var this_month_name_array = new Array("Jan","Feb","Mar","Apr","May","Jun","July"," Aug","Sept","Oct","Nov","Dec") //predefine month names
var this_date_timestamp = new Date()
var this_weekday = this_date_timestamp.getDay()
var this_date = this_date_timestamp.getDate()
var this_month = this_date_timestamp.getMonth()
var this_year = this_date_timestamp.getYear()
if (this_year < 1000)
this_year+= 1900;
if (this_year==101)
this_year=2001;
var this_date_string = this_weekday_name_array[this_weekday] + " " + this_date + " " + this_month_name_array[this_month]//concat long date string
// -->
function init ( )
{
timeDisplay = document.createTextNode ( "" );
document.getElementById("clock").appendChild ( timeDisplay );
}
function updateClock ( )
{
var currentTime = new Date ( );
var currentHours = currentTime.getHours ( );
var currentMinutes = currentTime.getMinutes ( );
var currentSeconds = currentTime.getSeconds ( );
// Pad the minutes and seconds with leading zeros, if required
currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;
// Choose either "AM" or "PM" as appropriate
//var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";
// 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 + ":" + currentMinutes;
// Update the time display
document.getElementById("clock").firstChild.nodeVa lue = currentTimeString;
}
function init2 ( )
{
timeDisplay = document.createTextNode ( "" );
document.getElementById("ampm").appendChild ( timeDisplay );
}
//function amPm ( )
//{
// var currentTime = new Date ( );
// var currentHours = currentTime.getHours ( );
// Choose either "AM" or "PM" as appropriate
// var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";
// 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 = timeOfDay;
// Update the time display
// document.getElementById("ampm").firstChild.nodeVal ue = currentTimeString;
//}
// -->
</script>
</head>
<body onload="onLoad()">
<center><div id="fond" style="display:block;position: absolute;z-order:10; top: 0px; left: 0px; width: 90px; height: 90px;">
<img src="widget.png">
</div></center>
<center><div id="icon" style="display:block;position: absolute;z-order:10; top: 180px; left: 120px; width: 90px; height: 90px;">
<img id="weatherIcon" src=""/>
</div></center>
<div id="WeatherContainer">
<div id="TextContainer">
<p style="display:block;position: absolute; top: 185px;left:20px;right:0px;width: 220px;text-shadow: 0px 2px 2px black;font-size:1.4em;" id="city"></p>
<p style="display:block;position: absolute; top: 220px;left:217px;width: 310px;text-shadow: 0px 2px 2px black;" id="temp"></p>
<p style="display:block;position: absolute; top: 213px;left:20px;width: 50px;text-align: left;text-shadow: 0px 2px 2px black;font-size:1.0em;" id="desc"></p>
<p style="display:block;position: absolute; top: 222px;left:268px;width: 310px;color: white;text-shadow: 0px 2px 2px black;font-size:12px;" id="hi" >H:</p>
<p style="display:block;position: absolute; top: 235px;left:268px;width: 310px;color: white;text-shadow: 0px 2px 2px black;font-size:12px;" id="low" >L:</p>
</div>
</div>
<div id="Forecast" >
<p style="display:block;position: absolute; top: 210px;left:285px;width: 310px;color: white;text-shadow: 0px 2px 2px black;font-size:12px;" id="hi0" ></p>
<p style="display:block;position: absolute; top: 223px;left:285px;width: 310px;color: white;text-shadow: 0px 2px 2px black;font-size:12px;" id="low0" ></p>
</div>
</div>
<table style="position: absolute; top: 160px; left: 170px; width: 180px; height: 461px;" cellspacing="0" cellpadding="0" align="LEFT">
<tr align="CENTER" valign="top" border="0" cellpadding="0">
<td height="12" valign="top" margin-left:150 >
<span id="clock">
<script language="JavaScript">updateClock(); setInterval('updateClock()', 1000 )</script></span><span id="ampm">
<script language="JavaScript">amPm(); setInterval('amPm()', 1000 )</script>
</span>
</td>
</tr>
<tr>
<td id="date" valign="top">
<script language="JavaScript">document.write(this_date_str ing)</script>
</td>
</tr>
<table style="position: absolute; top: -130px; left: 40px; width: 320px; height: 461px;" cellspacing="" cellpadding="" align="center">
<td height="40" border="0">
<img src="dg8.gif" name="hr1" width="50" heigth="69"><img
src="dgb.gif" name="b1" width="2" heigth="69"><img
src="dg8.gif" name="hr2" width="50" heigth="69"><img
src="dgc.gif" name="c" width="35" heigth="69"><img
src="dg8.gif" name="mn1" width="50" heigth="69"><img
src="dgb.gif" name="b2" width="2" heigth="69"><img
src="dg8.gif" name="mn2" width="50" heigth="69">
</td></table>
<script type="text/javascript"><!-- start
dg0 = new Image();dg0.src = "dg0.gif";
dg1 = new Image();dg1.src = "dg1.gif";
dg2 = new Image();dg2.src = "dg2.gif";
dg3 = new Image();dg3.src = "dg3.gif";
dg4 = new Image();dg4.src = "dg4.gif";
dg5 = new Image();dg5.src = "dg5.gif";
dg6 = new Image();dg6.src = "dg6.gif";
dg7 = new Image();dg7.src = "dg7.gif";
dg8 = new Image();dg8.src = "dg8.gif";
dg9 = new Image();dg9.src = "dg9.gif";
dgc = new Image();dgc.src = "dgc.gif";
dgz = new Image();dgz.src = "dgz.gif";
dgb = new Image();dgb.src = "dgb.gif";
function dotime(){
theTime=setTimeout('dotime()',1000);
d = new Date();
hr= d.getHours()+100;
mn= d.getMinutes()+100;
se= d.getSeconds()+100;
if(hr==100){hr=112;am_pm='am';}
else if(hr<112){am_pm='am';}
else if(hr==112){am_pm='pm';}
else if(hr>112){am_pm='pm';hr=(hr-12);}
tot=''+hr+mn+se;
if (se%2==0){document.c.src = 'dgz.gif';}
else {document.c.src = 'dgc.gif';}
document.hr1.src = 'dg'+tot.substring(1,2)+'.gif';
document.hr2.src = 'dg'+tot.substring(2,3)+'.gif';
document.mn1.src = 'dg'+tot.substring(4,5)+'.gif';
document.mn2.src = 'dg'+tot.substring(5,6)+'.gif';
}
dotime();
//end -->
</script>
</body></html>



LinkBack URL
About LinkBacks
Reply With Quote
