« Return to Thread: Date.prototype.toISOString and Invalid Date

Re: Date.prototype.toISOString and Invalid Date

by Adam Peller-5 :: Rate this Message:

Reply to Author | View in Thread

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


Inactive hide details for John Cowan ---06/10/2009 11:21:08 AM---Adam Peller scripsit:John Cowan ---06/10/2009 11:21:08 AM---Adam Peller scripsit:


To

Adam Peller/Cambridge/IBM@IBMUS

cc

Allen Wirfs-Brock <Allen.Wirfs-Brock@...>, "es5-discuss@..." <es5-discuss@...>, Garrett Smith <dhtmlkitchen@...>, "es-discuss@..." <es-discuss@...>

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 times of peril or dubitation,          
http://www.ccil.org/~cowan
Perform swift circular ambulation,
With loud and high-pitched ululation.





_______________________________________________
es-discuss mailing list
es-discuss@...
https://mail.mozilla.org/listinfo/es-discuss


pic09562.gif (1K) Download Attachment

 « Return to Thread: Date.prototype.toISOString and Invalid Date