Log In · Register

 
birthday counter, change other than birthday
agskora
post Jan 5 2005, 10:02 AM
Post #1


Senior Member
***

Group: Member
Posts: 34
Joined: Nov 2004
Member No: 62,224



Hi I'm trying to get the counter to countdown to something other than my birthday. I tried playing with it put when I preview it, it says 14 days until my 0th school starts. How do I get the 'my 0th' out? Please help.

<!-- begin code provided by createblog.com -->
<!-- begin code provided by createblog.com -->
</tr><script language="JavaScript1.2">

var today = new Date;
var Future0 = new Date;

var BirthMonth = 1;
var BirthDate = 18;
var BirthYear = 2005;
BirthMonth--;

Future0.setMonth(BirthMonth, BirthDate);
if (Date.parse(today) > Date.parse(Future0))
{
Future0.setFullYear(today.getYear()+1);
age = (today.getYear() - BirthYear) + 1;
}
else
{age = today.getYear() - BirthYear;}

if (age % 10 == 0)
ageend = 'th';
else if (age % 10 == 4)
ageend = 'th';
else if (age % 10 == 5)
ageend = 'th';
else if (age % 10 == 6)
ageend = 'th';
else if (age % 10 == 7)
ageend = 'th';
else if (age % 10 == 8)
ageend = 'th';
else if (age % 10 == 9)
ageend = 'th';
else if (age % 10 == 1)
ageend = 'st';
else if (age % 10 == 2)
ageend = 'nd';
else if (age % 10 == 3)
ageend = 'rd';


var faraevent = "<font color=#6699FF><i>school starts</font>";

today1 = Date.parse(today);
future1 = Date.parse(Future0);
secleft = future1 - today1;
miliday = 24 * 60 * 60 * 1000;
daysleft = secleft/miliday;
daysleftint = Math.round(daysleft);

if (daysleftint > 1)
document.write(" ", daysleftint, " days until <font color=#660099>my <i>", age, ageend, "</i> school starts</font>");
else if (daysleftint == 1)
document.write("<font color=#6699FF>my <i>", age, ageend, "</i> school starts</font> is tomorrow");
else if (today1 == future1)
document.write("<font color=#6699FF>my <i>", age, ageend, "</i> till school starts</font> is today");
else
document.write("passed");
</script><br>
<!-- end code provided by createblog.com -->
<!-- end code provided by createblog.com -->
 

Posts in this topic
agskora   birthday counter   Jan 5 2005, 10:02 AM
starwberry_applez   i fix it!!! try this: CODEBOX: -> rig...   Jan 5 2005, 10:22 AM


Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: