[PATCH] IE compatibility for Date.parse

Aurélien Gâteau agateau at dental-on-line.fr
Fri Mar 31 18:04:07 BST 2006


Hello,

I'm a bit ashamed of this patch, but it seems that quite a lot of broken 
Javascript code fail on Date.parse(txt) when txt is in the 'xx/xx/xxxx' 
format (dd/mm/yyyy in France, mm/dd/yyyy elsewhere).
Real life example is the bank website of one of my customers: 
http://www.bfcoi.com/

I can't provide a link to the bad page because it's a cash transfer form, but 
the Javascript is here: http://www.bfcoi.com/onlinebanking/date.js
The offending function is fmtDate(pDate).
(In case it changes, I attach a copy of it to this message.)

The patch is for KDE 3.4.3, but seems to apply on the 3.5 branch too 
(untested).

The attached dateparse.html file contains some Javascript to test various 
values. Here is the output, on different browsers:

Konqueror 3.4.3
---------------
Mar 30 2006    1 143 669 600 000
30/03/2006     NaN
03/30/2006     1 143 669 600 000
24/55/2006     NaN
70/55/2006     NaN
00/00/2006     NaN
01/452/2006    1 175 032 800 000

Firefox 1.0.4
-------------
Mar 30 2006    1 143 669 600 000
30/03/2006     1 212 444 000 000
03/30/2006     1 143 669 600 000
24/55/2006     1 201 129 200 000
70/55/2006     NaN
00/00/2006     NaN
01/452/2006    NaN

Firefox 1.5 / IE 6.0 / Konqueror 3.4.3 with patch
-------------------------------------------------
Mar 30 2006    1 143 669 600 000
30/03/2006     1 212 444 000 000
03/30/2006     1 143 669 600 000
24/55/2006     1 201 129 200 000
70/55/2006     315 097 200 000
00/00/2006     1 133 305 200 000
01/452/2006    1 175 032 800 000

PS: Please CC me.
-- 
Aurélien Gâteau - agateau at dental-on-line.fr
Dental-on-line
23 rue du Départ
75014 PARIS - FRANCE
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdelibs_kjs-date_parse_ie_compatibility-kde3.4.diff
Type: text/x-diff
Size: 855 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20060331/20d6e315/attachment.diff>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20060331/20d6e315/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: date.js
Type: application/x-javascript
Size: 1747 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20060331/20d6e315/attachment.bin>


More information about the kfm-devel mailing list