Date.prototype.toISOString and Invalid Date

Adam Peller apeller at us.ibm.com
Wed Jun 10 08:47:03 PDT 2009


NaN is already part of the ECMAScript language.  There is an underlying
Number representation of Date, but I'll grant you it's not a perfect fit as
there are no Date literals.  Returning null is another option, I suppose,
but one that's likely to create even more problems.

-Adam



                                                                           
             John Cowan                                                    
             <cowan at ccil.org>                                              
                                                                        To 
             06/10/2009 11:21          Adam Peller/Cambridge/IBM at IBMUS     
             AM                                                         cc 
                                       Allen Wirfs-Brock                   
                                       <Allen.Wirfs-Brock at microsoft.com>,  
                                       "es5-discuss at mozilla.org"           
                                       <es5-discuss at mozilla.org>, Garrett  
                                       Smith <dhtmlkitchen at gmail.com>,     
                                       "es-discuss at mozilla.org"            
                                       <es-discuss at mozilla.org>            
                                                                   Subject 
                                       Re: Date.prototype.toISOString and  
                                       Invalid Date                        
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Adam Peller scripsit:

> I don't feel strongly on this, but it does strike me as odd that
> a function intended to avoid culturally-sensitive output would use
> an English phrase.  I'd lean towards IE/Opera, using notation from
> ECMAScript that is equally cryptic to all cultures :-)  At least that
> would be consistent with Number.toString() and would reinforce the fact
> that there are other methods to produce strings in the user's locale.

In fact, "NaN" is an abbreviation of an English phrase, namely "not
a number".  But neither dates nor date strings are numbers.  What say
you to "NaD"?

--
John Cowan                                cowan at ccil.org
At times of peril or dubitation,          http://www.ccil.org/~cowan
Perform swift circular ambulation,
With loud and high-pitched ululation.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es5-discuss/attachments/20090610/bd85ab5a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/es5-discuss/attachments/20090610/bd85ab5a/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic09562.gif
Type: image/gif
Size: 1255 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/es5-discuss/attachments/20090610/bd85ab5a/attachment-0001.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/es5-discuss/attachments/20090610/bd85ab5a/attachment-0002.gif>


More information about the es5-discuss mailing list