Hi there,

all the following is also in the bug-report I've opened for this
  http://bugzilla.qooxdoo.org/show_bug.cgi?id=5521
This posting is just to inform anyone who's interested (maybe ;) )

Description:
------------
When the DateFormat is filled with an "Invalid Date", it may start to run
an endless loop. At least when the 'D' Format-Specifier is used.


To reproduce:
-------------
As an example for an "Invalid Date", the '32rd of December' is used.
The example might not work in every locale. It might be needed to use a
differend date literal (e.g. '32/12/2011')
<code>
  (new qx.util.format.DateFormat("D")).format(new Date("2011-12-32"));
</code>


Analysis:
---------
In the provate method '__getDayInYear' of 'qx.util.format.DateFormat'
a while-loop check does : 'helpDate.getMonth() != 0', which is always 'true'
for 'Invalid Date's.


Proposed Fix:
-------------
To avoid checking every method or path of 'qx.util.format.DateFormat',
I would just change the initial "null-check" at the beginning of the
'format'-method.

Current (r28485):
<code>
  // check for null dates
  if (date == null) {
    return null;
  }
</code>

Fixed:
<code>
  // check for null/invalid dates
  if (!date || isNaN(date)) {
    return null;
  }
</code>


Best regards,
  Peter

------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to