...

View Full Version : Add st nd rd th to date widget



iMaxx
08-21-2010, 08:58 PM
Hello I'm new here :)
Ive used these forums slot so I know you people are good! Lol*I just want a small favor from you
Can anyone st nd rd th as appropriate to the following widget for me PLEASE??
[CODE]
<html>

<head><title>newclock</title><base href="Private/"/></head>



<style>



** *SPAN#clock

{

** * * *font-family: Helvetica;

** * * *font-weight: bold;*

** * * *color: #575a5b;*

** * * *text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.7); **

** * * */*text-shadow: #ac7a00 0px 1px 0px;*/

** * * *font-size: 40px;

** * * *



}



** *SPAN#ampm

{

** * * *font-family: Helvetica;

** * * *font-weight: bold;*

** * * *color: #575a5b;*

** * * *text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.7); **

** * * */*text-shadow: #ac7a00 0px 1px 0px;*/

** * * *font-size: 22px;



}



** *TD#date*
D
{

** * * *font-family: Helvetica;

** * * *font-weight: bold;*

** * * *text-align: left;

** * * *color: #575a5b;*

** * * *text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.7); **

** * * */*text-shadow: #FFFFFF 0px 1px 0px;*/

** * * *font-size: 13px;

** * * *text-transform: uppercase;



}

** * * *

</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_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.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","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() * *



//document.getElementById("calendar").firstChild.nodeValue = this_weekday_name_array[this_weekday] + " " + this_date + " " + this_month_name_array[this_month]//concat long date string

**

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 >
[CODE]











<table style="position: absolute; top: 310px; left: 105px; width: 180px; height: 461px;" cellspacing="0" cellpadding="0" align="right">

<tr align="left" valign="top" *border="0" cellpadding="0">

** *<td height="12" valign="top" margin-left="120" >

** *<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">

** * * *<span id="calendar">

** * * *<script language="JavaScript">calendarDate(); setInterval('calendarDate()', 1000 )</script>

** * * *</span>

** *</td>

</tr>

</table>

** *<object data="WeatherWidget/WeatherWidget.html" *type="text/html" height="480" width="320">

** * * <p></p>

** *</object>



</body>

</html>

iMaxx
08-23-2010, 02:47 PM
can anyone help me with this PLEASE!?!

VIPStephan
08-23-2010, 04:09 PM
I would say if you put your properly formatted code into the respective
tags (small ‘#’ button in the reply window) then someone could possibly feel inclined to at least take a look at it. The way your posted code looks now it’s just not gonna happen.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum