Re: critique requested

by "Michael West" <webmaster(at)mwwebdesign.com>

 Date:  Tue, 1 Feb 2000 22:43:12 -0800
 To:  "\"Comharsa\"" <comharsa(at)clara.net>
 Cc:  "\"hwg-critique\"" <hwg-critique(at)hwg.org>
  todo: View Thread, Original
Hi Brian

Just a few lines then we can take this off the list since it doesn't really
belong here if you want to continue this discussion. The getFullYear ()
function was introduced for JS 1.3 because of the Y2K issue which I'm sure
you knew, the getYear() function only works for 2 digits and has been around
since JS 1.0 that's why you need to add a var for getYear()  to turn the two
digits into four such as:

var year=mydate.getYear()
if (year<2000)
year += (year < 1900) ? 1900 : 0

the var I used above is Y2K compliant unlike many others found on the
internet and because the script was written in JS 1.0 it will work on all
browsers that support JS even Opera and as you can see from the other
snippet that Matt wrote he wanted to have the widest possible audience. So
the single line you would add to make his original script work will not work
on older browsers. Plus I would have to disagree on it being a complicated
script it's really very simple and was one of the first scripts I wrote, the
only thing extra about it is the document write for the font info and the
div tags which I added for Dream Weaver users.


Brian wrote:

>Sorry, I'm not. The problem is that IE and NS now do different things with
>the getYear() function, as I said. I never said that either of them didn't
>support it, they just implement it in different ways. This is why the
>getFullYear() function was introduced but it is for JS 1.3 capable browsers
>only. I also have Dreamweaver but there is no need for such a complicated
script,
>a single line added to the script makes it work.

Matt wrote:
<snip>
>Since this is the agency's primary marketing tool, it needs to work for any
visitor we direct there.
</snip>

--
Sincerely,
Michael West
http://www.mwwebdesign.com/

HTML: hwg-critique mailing list archives, maintained by Webmaster @ IWA