Closed Bug 187816 Opened 23 years ago Closed 11 years ago

tva.gov - javascript date problem prevents data display

Categories

(Tech Evangelism Graveyard :: English US, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: mozilla, Unassigned)

References

()

Details

(Whiteboard: [technote-needed])

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.3a) Gecko/20021212 Build Identifier: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.3a) Gecko/20021212 In the site-specific pages accessible from http://www.tva.gov/greenpowerswitch/solar_sites.htm , data and charts should be displayed after valid dates are selected (and Go is hit). In Mozilla, an error message like "You must select a date earlier than today's date. Today is January 5,." is displayed instead. iE 6.0 displays the data and charts. Reproducible: Always Steps to Reproduce: 1. Go to URL. 2. Scroll down, select valid previous date such as 04 January, 2002 3. Hit Go. Actual Results: Error message popup is displayed. Expected Results: Display site-specific "Fast Facts" table and solar power chart. Using default theme, tabs. Saw other javascript date bugs listed, but didn't wade through them all (sorry).
The site seems to just be buggy... it basically does: todays = ((new Date()) + '').split(' '); and then assumes the last element in the array is the year (it's actually the timezone name).
*** Bug 187820 has been marked as a duplicate of this bug. ***
Attached file Reduced testcase
Boris' analysis is correct. Load the reduced testcase and hit 'Test'. In NN4.7 and IE6, the date passes as valid; in Mozilla, it doesn't. As Boris says, the site assumes that the last element in a JavaScript date is the year. This is true in NN4.7 and IE6, but not Mozilla. Just try this HTML: <script> var dt = Date().toString(); document.write(dt); </script> NN4 ---> Mon Jan 06 23:16:02 GMT-0800 (Pacific Standard Time) 2003 IE6 ---> Mon Jan 06 23:15:59 2003 Moz ---> Mon Jan 06 2003 23:15:56 GMT-0800 (Pacific Standard Time) That's what's causing the problem. The site should use the getFullYear() method to get the year (NOTE: don't use the deprecated method getYear()). Reassigning to Evangelism component -
Assignee: rogerl → bclary
Status: UNCONFIRMED → NEW
Component: JavaScript Engine → US Gov
Ever confirmed: true
OS: Windows 98 → All
Product: Browser → Tech Evangelism
QA Contact: pschwartau → chrisn
Hardware: PC → All
Version: Trunk → unspecified
common enough to get a short note written about it.
Summary: javascript date problem prevents data display → tva.gov - javascript date problem prevents data display
Whiteboard: [technote-needed]
tech evang june 2003 reorg
Assignee: bc → english-us
Component: US Gov → English US
QA Contact: chrisn → english-us
contact info tvainfo@tva.gov
Status: NEW → ASSIGNED
Target Milestone: --- → Oct
[bug248549notfixed]
still broken
Page no longer exists, closing.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: