Time of day text. Copy past into any widget.




Had a couple emails asking how to pull the Time of day text from miWeather and add to another widget. It is pretty simple to do.  If you follow this small tutorial you can add it with no coding knowledge.

First you will need this code.

<table style="position: absolute;top: 70px; left: 0px; width: 320px; height: 461px;"><tr valign="top" style="text-align: center; font-weight: 400; color: #ffffff; text-shadow: 0 0 0.1em rgba(0, 0, 0, 1); font-size: 18px; opacity:0.8;" border="0" align="center" cellpadding="0"><td>
<span>
<script type="text/javascript">
{

var d = new Date();

var h = d.getHours();

if (h < 1) document.write("It's midnight, Quit now?");
else if (h < 3) document.write("gettting alot done?");
else if (h < 6) document.write("too early to get up");
else if (h < 7) document.write("still sleeping?");
else if (h < 10) document.write("Good morning sunshine");
else if (h < 12) document.write("Take a break");
else if (h < 13) document.write("It's Lunch time");
else if (h < 16) document.write("Good Afternoon");
else if (h < 19) document.write("Time for dinner");
else if (h < 21) document.write("Day is almost over");
else if (h < 23) document.write("Grab a drink relax");

else document.write("Good Evening");

}


</script>
</span></table>

Starts with <table> and ends with </table> NOTE everything between the "" is changeable.

Where to put it

In every widget there is a main html. This html may be named. LockBackground.html = Lockscreen
Widget.html = iWidget/Winterboard Springboard or Wallpaper.html = Springboard.

find your html. Open this html in ifile. Look for <body> There ONLY should be one <body>, but I have fixed tons of code that have many <body> tags. If yours has more than <body></body> please contact the so called creator and tell him to fix.

Otherwise paste the code above, after the <body>

so your code should look like this.

<body>
<table style="position: absolute;top: 70px; left: 0px; width: 320px; height: 461px;"><tr valign="top" style="text-align: center; font-weight: 400; color: #ffffff; text-shadow: 0 0 0.1em rgba(0, 0, 0, 1); font-size: 18px; opacity:0.8;" border="0" align="center" cellpadding="0"><td>
<span>
<script type="text/javascript">
{

var d = new Date();

var h = d.getHours();

if (h < 1) document.write("It's midnight, Quit now?");
else if (h < 3) document.write("gettting alot done?");
else if (h < 6) document.write("too early to get up");
else if (h < 7) document.write("still sleeping?");
else if (h < 10) document.write("Good morning sunshine");
else if (h < 12) document.write("Take a break");
else if (h < 13) document.write("It's Lunch time");
else if (h < 16) document.write("Good Afternoon");
else if (h < 19) document.write("Time for dinner");
else if (h < 21) document.write("Day is almost over");
else if (h < 23) document.write("Grab a drink relax");

else document.write("Good Evening");

}


</script>
</span></table>

Thats it hope you enjoy. If any questions please ask below.

Follow Us


No comments:

Post a Comment