internet.com - Y2K failure in date script due to getYear()

VERIFIED FIXED in Nov

Status

--
trivial
VERIFIED FIXED
17 years ago
4 years ago

People

(Reporter: Tony.Tovar, Unassigned)

Tracking

unspecified

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

17 years ago
This web-site includes a javascript to add the current date to each page.  It
works fine in IE 5.5 but reports "Feb. 4, 102" in Mozilla.

The code reads:
 <script LANGUAGE="JavaScript" src =" /java/date.js">
which I assume is referring to the file at:
 http://cws.internet.com/java/date.js
 
(This might be caused by my AdSubtract proxy but I'm pretty sure I've bypassed
it while testing this.)

Comment 1

17 years ago

*** This bug has been marked as a duplicate of 65681 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → DUPLICATE

Comment 2

17 years ago
Verified Duplicate. Here is the relevant portion of the other bug:

> The use of Date.getYear() was deprecated in favour of .getFullYear()
> (which returns the full four-digit value for the year). See bug 22964 
> for further information on this -
Status: RESOLVED → VERIFIED

Comment 3

17 years ago
And to be complete, here is the offending code from
view-source:http://cws.internet.com/java/date.js

var months=new Array(13);
months[1]="January";
months[2]="February";
months[3]="March";
months[4]="April";
months[5]="May";
months[6]="June";
months[7]="July";
months[8]="August";
months[9]="September";
months[10]="October";
months[11]="November";
months[12]="December";

var time=new Date();
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var year=time.getYear();

if (year < 100) {
        year = "19" + time.getYear() }
else if (year == 100) {
        year = "2000" }
else {
        year=time.getYear() }

document.write(lmonth + " " + date + ", " + year)

Comment 4

17 years ago
Better: reopen this for Evangelism
Status: VERIFIED → UNCONFIRMED
Resolution: DUPLICATE → ---

Comment 5

17 years ago
Reassigning to Tech Evangelism; the site should use getFullYear(),
not the deprecated getYear() function
Assignee: rogerl → doronr
Status: UNCONFIRMED → NEW
Component: JavaScript Engine → US General
Ever confirmed: true
Product: Browser → Tech Evangelism
QA Contact: pschwartau → zach
Version: other → unspecified

Updated

17 years ago
Blocks: 114153
Keywords: evang500
Summary: date script reports "102" as year → internet.com - date script reports "102" as year

Comment 6

17 years ago
*** Bug 145906 has been marked as a duplicate of this bug. ***

Comment 7

16 years ago
Contact address is cwsapps@internet.com
Severity: normal → trivial
OS: Windows NT → All
Hardware: PC → All
Summary: internet.com - date script reports "102" as year → internet.com - Y2K failure in date script due to getYear()

Comment 8

16 years ago
tech evang june 2003 reorg
Assignee: doron → english-us
QA Contact: zach → english-us

Comment 9

15 years ago
Trouble is, getYear() is still supported on other browsers.  People viewing the
same site in IE and Mozilla will have the opinion that Mozilla "is ****" because
it shows 103 (for 2003) and IE shows 2003.

There's no way you can "Tech Evangalise" to all those web developers out there,
so how about putting this bug in the "to be fixed" queue again.

Cheers
Andrew

Comment 10

15 years ago
contact info cwsapps@internet.com
Status: NEW → ASSIGNED
Target Milestone: --- → Nov

Comment 11

15 years ago
Created attachment 134241 [details]
Test case

This test case returns 103 as current year.
If "deprecated" means "possibly not working" this bug should be closed as
WONTFIX.

Comment 12

15 years ago
Andrew: Discussion about changing getYear() in Mozilla belongs in bug 22964, not
here.

Alvaro: This is a tech evang bug.  Tech evang bugs are usually left open until
the site (in this case, http://cws.internet.com/reviews/plugins-shock.html)
fixes itself.

Comment 13

14 years ago
The date script no longer exists, it just forwards back to the homepage and
there is no date to be found on any page

marking fixed
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago14 years ago
Resolution: --- → FIXED

Comment 14

14 years ago
v
Status: RESOLVED → VERIFIED
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.