View Full Version : Custom Dates...


blackhawk007
09-05-2005, 10:09 PM
how do you get those custom dates for example instead of "Monday, September 5" you can change it to say something like "Sing Me Anything on Monday, September 5"???? please help me! thanks

oincubusx
09-05-2005, 11:55 PM
<script type="text/javascript">
function replaceWordsDates()
{
// ***add the Months or Days you wish to replace below
var oldWordsDates = new Array(
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
",",
"01,",
"02,",
"03,",
"04,",
"05,",
"06,",
"07,",
"08,",
"09,",
"10,",
"11,",
"12,",
"13,",
"14,",
"15,",
"16,",
"17,",
"18,",
"19,",
"20,",
"21,",
"22,",
"23,",
"24,",
"25,",
"26,",
"27,",
"28,",
"29,",
"30,",
"31,",
"2004",
"2005",
"Sunday");

// *** add the replacing Months or Days etc. below
var newWordsDates = new Array(
"jhan-yoo-air-ee",
"feb-yoo-air-ee",
"mharch",
"ay-pril",
"mhay",
"joon",
"jel-eye",
"aug-uzt",
"sept-em-ber",
"oc-toe-ber",
"noe-vem-ber",
"dee-cem-ber",
"mun-dai",
"tuez-dai",
"wenz-dai",
"thurz-dai",
"fry-dai",
"sat-ur-dai",
"~",
"1st~",
"2nd~",
"3rd~",
"4th~",
"5th~",
"6th~",
"7th~",
"8th~",
"9th~",
"10th~",
"11th~",
"12th~",
"13th~",
"14th~",
"15th~",
"16th~",
"17th~",
"18th~",
"19th~",
"20th~",
"21th~",
"22th~",
"23th~",
"24th~",
"25th~",
"26th~",
"27th~",
"28th~",
"29th~",
"30th~",
"31th~",
"2oo4",
"2oo5",
"son-dai");
allDivData = document.getElementsByTagName('div');

var collections = new Array(allDivData);

for (var k = 0; k < collections.length; ++k )
{
for (var i = 0; i < collections[k].length; ++i )
{
if (collections[k][i].innerHTML.indexOf('DIV') == -1)
{
for ( var n = 0; n < oldWordsDates.length; ++n )
{
var indx = collections[k][i].innerHTML.indexOf(oldWordsDates[n])
while (indx != -1)
{
var replacement = '';
indx = collections[k][i].innerHTML.indexOf(oldWordsDates[n]);
replacement = collections[k][i].innerHTML.replace(oldWordsDates[n], newWordsDates[n]);
collections[k][i].innerHTML = replacement;
break;
}
}
}
}
}
}
replaceWordsDates();
</script>


just.... change the corresponding words and stuff to the dates and stuff that you want it to say... when you edit what it says, make sure you dont delete anything other than the replacement characters.