Web Analytics Made Easy -
StatCounter Is this possible? Can someone help? - CodingForum

Announcement

Collapse
No announcement yet.

Is this possible? Can someone help?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is this possible? Can someone help?

    This javascript I have found is pretty good, but not quite what I need.......

    Latest news coverage, email, free stock quotes, live scores and video are just the beginning. Discover more every day at Yahoo!


    I need to find a javascript that will write out the full date using the same images ie...

    Monday 1st July, 2002

    Is it possible to adapt this while using twelve images for months, 7 for days, and making a st, nd, rd and th for the date? The numbers are pretty simple (x10). The images aren't a problem. The Javascript is.

    I would prefer if possible to keep the <BODY> Tag clear of "onload" or anything for that matter.
    (Just a linked .js file is ideal!)

    Can anyone help me or am I looking to deep into this?

  • #2
    gol...
    just a checkout® this link...
    Click here for comprehensive JavaScript tutorials, and over 400+ free scripts!

    n' ifin' its what youre looking for??? thennn you can just a externalize® the javascript...lol...
    The New JustaBuster Version 2.0 OR JustaBusta Lite V2.0
    ...just a special® thanx kinda hugs to jkd n' nex ...:O)))

    CommemorateWTC.com --Please lend your support

    Comment


    • #3
      Here's a javascript I adapted from an ASP script I wrote, that does just that:

      Code:
      /* Today's Date in real English © 2002 Rob K. Davis */
      var monthname = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
      var weekdayname = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
      var mydate = new Date();
      var myday = mydate.getDay();
      var mymonth = mydate.getMonth();
      var mydayno = mydate.getDate();
      var dateext = "th"
      	if(mydayno == 1 || mydayno == 21 || mydayno == 31){
      		dateext = "st";
      	}
      	else if(mydayno == 2 || mydayno == 22){
      		dateext = "nd";
      	}
      	else if(mydayno == 3 || mydayno == 23){
      		dateext = "rd";
      	}
      var myyear = ((mydate.getYear() < 100) ? "19" : "") + mydate.getYear();
      var clientdate = weekdayname[myday] + ", "+ monthname[mymonth] + " "+ mydayno + dateext + ", "+ myyear;


      P.S. To write the "English Date" to the page, you'd include that as a separate .js file, and just write the date to the page like:

      <script language="javascript" type="text/javascript">
      <!--
      document.write(clientdate);
      // -->
      </script>
      Last edited by whammy; Jul 1, 2002, 07:18 PM.
      Former ASP Forum Moderator - I'm back!

      If you can teach yourself how to learn, you can learn anything. ;)

      Comment


      • #4
        P.S. How to implement the images, you said is the easy part - so I'll leave that to you - but you're right, it shouldn't be too hard.

        i.e. I'd just have an image for every possible letter, number, comma, etc. that the date script could return (perhaps stored in a 2D array or something to make it somewhat simple, (or even 2 associated arrays)), and loop through the string, then write the appropriate image to the page for that character.

        Former ASP Forum Moderator - I'm back!

        If you can teach yourself how to learn, you can learn anything. ;)

        Comment

        Working...
        X