Last Comment Bug 309925 - Date and Time stamp on page appear as letters, possible JavaScript issue
: Date and Time stamp on page appear as letters, possible JavaScript issue
Status: VERIFIED FIXED
: regression, verified1.8
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: x86 Linux
: -- normal (vote)
: ---
Assigned To: Bob Clary [:bc:]
:
Mentors:
http://my.myway.com/
Depends on: 301738
Blocks:
  Show dependency treegraph
 
Reported: 2005-09-24 18:07 PDT by Edward
Modified: 2006-02-18 00:57 PST (History)
0 users
bob: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (1.58 KB, patch)
2005-09-25 01:20 PDT, Bob Clary [:bc:]
mrbkap: review+
brendan: superreview+
asa: approval1.8b5+
Details | Diff | Review

Description Edward 2005-09-24 18:07:07 PDT
User-Agent:       Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.9a1) Gecko/20050924 SeaMonkey/1.1a
Build Identifier: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.9a1) Gecko/20050924 SeaMonkey/1.1a

Date and time stamp for items to the right of the Top News, Business News,
Technology News, etc. headings, apppear as "MMM NaN, NaN:0NaN am ET" instead of
displaying the actual date and time.

I opened a Page Source window and it appears to be related to JavaScript.  

When the same page is viewed with Mozilla Firedox 1.0.7 Linux however,
(Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7.12) Gecko/20050920
Firefox/1.0.7), the date and time appear correctly.





Reproducible: Always

Steps to Reproduce:
1.Load referenced web page.
2.Date and time appear as "MMM NaN, NaN:0NaN am ET", instead of displaying the
correct date and time.
3.

Actual Results:  
Date and time as described did not display as expected.

Expected Results:  
Software should have displayed correct date and time.
Comment 1 Andrew Schultz 2005-09-24 22:53:19 PDT
The page attempts to parse (with Date.parse) the date "Sep 24, 11:58 pm(ET) 105"
(105 is what Date.getYear() returns).  With current trunk, Date.parse returns "NaN".

This regressed between seamonkey trunk builds 2005072906 and 2005073005, which
means this is from bug 301738.

==> Javascript
Comment 2 Bob Clary [:bc:] 2005-09-25 01:20:29 PDT
Created attachment 197319 [details] [diff] [review]
patch

Since bug 301738, if the string contains a time HH:MM without seconds, the next
number will be treated as the seconds which in this case will result in the
year being treated as seconds. By protecting the assignment to sec with the
prevc value of ':', we prevent this from happening. This is the regression.

The second issue is if a '(' follows a number without an intervening space, a
syntax error occurs in Mozilla but IE does not treat it as such. 

This will make "Sep 24, 11:58 pm(ET) 105" and "Sep 24, 11:58 pm (ET) 105" both
valid dates.

This is wallpaper, but I'm not sure I want to try to do more.
Comment 3 Bob Clary [:bc:] 2005-09-25 01:47:30 PDT
RCS file: /cvsroot/mozilla/js/tests/js1_5/Date/regress-309925-01.js,v
done
Checking in regress-309925-01.js;
/cvsroot/mozilla/js/tests/js1_5/Date/regress-309925-01.js,v  <-- 
regress-309925-01.js
initial revision: 1.1
done
RCS file: /cvsroot/mozilla/js/tests/js1_5/Date/regress-309925-02.js,v
done
Checking in regress-309925-02.js;
/cvsroot/mozilla/js/tests/js1_5/Date/regress-309925-02.js,v  <-- 
regress-309925-02.js
initial revision: 1.1
done
Comment 4 Brendan Eich [:brendan] 2005-09-25 11:22:14 PDT
Comment on attachment 197319 [details] [diff] [review]
patch

Gross, but I guess it falls under Postel's rule.

/be
Comment 5 Blake Kaplan (:mrbkap) (please use needinfo!) 2005-09-26 12:58:23 PDT
Comment on attachment 197319 [details] [diff] [review]
patch

r=mrbkap, well caught!
Comment 6 Bob Clary [:bc:] 2005-09-26 21:13:18 PDT
Checking in jsdate.c;
/cvsroot/mozilla/js/src/jsdate.c,v  <--  jsdate.c
new revision: 3.71; previous revision: 3.70
done

2005-09-26 21:10	bob%bclary.com 	mozilla/ js/ src/ jsdate.c 	3.71 	2/2  	Bug
309925, fix regression in parsing dates containing HH:MM caused by bug 301738,
r=mrbkap, sr=brendan
Comment 7 Bob Clary [:bc:] 2005-09-26 21:15:33 PDT
Comment on attachment 197319 [details] [diff] [review]
patch

Seeking approval for 1.8b5 for this simple, low risk fix to a regression.
Comment 8 Bob Clary [:bc:] 2005-09-27 19:36:54 PDT
2005-09-27 19:35	bob%bclary.com 	mozilla/ js/ src/ jsdate.c 	3.69.2.2 
MOZILLA_1_8_BRANCH  	2/2  	Bug 309925, fix regression in parsing dates
containing HH:MM caused by bug 301738, r=mrbkap, sr=brendan, a=asa
Comment 9 Bob Clary [:bc:] 2006-02-18 00:57:29 PST
v ff 1.5.0.1, 1.5, 1.6 20060217 win/linux/mac

Note You need to log in before you can comment on or make changes to this bug.