+ Reply
Results 1 to 13 of 13
  1. #1
    Green Apple
    Join Date
    Sep 2007
    Posts
    39
    Thanks
    4
    Thanked 7 Times in 3 Posts

    Default 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.

  2. #2
    Green Apple
    Join Date
    Feb 2008
    Posts
    59
    Thanks
    10
    Thanked 6 Times in 6 Posts

    +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

  3. #3
    What's Jailbreak?
    Join Date
    Oct 2008
    Posts
    4
    Thanks
    0
    Thanked 8 Times in 3 Posts

    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>

  4. The Following 2 Users Say Thank You to DermicSavage For This Useful Post:

    Ice9812 (10-13-2008), ranova (10-13-2008)

  5. #4
    Green Apple
    Join Date
    Feb 2008
    Posts
    59
    Thanks
    10
    Thanked 6 Times in 6 Posts

    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>

  6. #5
    What's Jailbreak?
    Join Date
    Oct 2008
    Posts
    4
    Thanks
    0
    Thanked 8 Times in 3 Posts

    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>

  7. 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)

  8. #6
    Green Apple
    Join Date
    Feb 2008
    Posts
    59
    Thanks
    10
    Thanked 6 Times in 6 Posts

    You are the man! Works like a champ! I appreciate you taking the time and you've been thanked bro!

  9. #7
    Green Apple
    Join Date
    Sep 2007
    Posts
    39
    Thanks
    4
    Thanked 7 Times in 3 Posts

    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 again
    Last edited by ranova; 10-13-2008 at 04:27 PM. Reason: Automerged Doublepost

  10. #8
    What's Jailbreak?
    Join Date
    Oct 2008
    Posts
    4
    Thanks
    0
    Thanked 8 Times in 3 Posts

    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.

  11. The Following 2 Users Say Thank You to DermicSavage For This Useful Post:

    96hondaex (10-15-2008), johnny69blaze (10-15-2008)

  12. #9
    What's Jailbreak?
    Join Date
    Aug 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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>

  13. #10
    My iPhone is a Part of Me
    Join Date
    May 2008
    Location
    Scranton
    Posts
    584
    Thanks
    164
    Thanked 197 Times in 155 Posts

    Quote Originally Posted by big8oy View Post
    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.


    >
    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 know
    Last edited by Ice9812; 10-15-2008 at 08:44 PM.
    If I Helped You Hit The Thanks Button

  14. #11
    What's Jailbreak?
    Join Date
    Aug 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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...

  15. #12
    Green Apple
    Join Date
    Jan 2009
    Posts
    64
    Thanks
    0
    Thanked 2 Times in 2 Posts

    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?

  16. #13
    Green 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>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts