Quote:
Originally Posted by Bear Hunter
Yeah, if you know something I don't...please share. I already tried putting:
var updateInterval = 35 //Minutes
in the calendar. js and it didn't work
|
i dont know much ...but the update interval was written into the .html file here ill post you the other clock/date widget file and show you what im talking about .....
this is a different widget than yours but if you scroll down to the bottom where the text is black youll see
<td align="center" valign="top">
<span id="calendar">
<script language="JavaScript">calendarDate(); setInterval('calendarDate()', 1000 )</script>
</span
..thats what was added that made it auto update:
PHP 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: 0px 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("January","Feburary","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()
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: 402px; 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>
...so i tired adding it to you code like this:
<span id="DisplayCalendarIcon">
<script language="JavaScript">DisplayCalendarIcon(); setInterval('DisplayCalendarIcon()', 1000 )</script>
</span>
...but like i said i dont know anything about writing code...it might be missing something for it to work right