Loading ...
Sorry, an error occurred while loading the content.

SV: SV: [json] new Date(NaN)

Expand Messages
  • Jakob Kruse
    Then apparently you didn’t say what you meant. No offense, that was what I needed to clarify. “…that different implementations of JSON.stringify([new
    Message 1 of 4 , Jun 18, 2009
    • 0 Attachment
      Then apparently you didn’t say what you meant. No offense, that was what I needed to clarify.

      “…that different implementations of JSON.stringify([new Date()]) do different things.”

      /Jakob


      Fra: json@yahoogroups.com [mailto:json@yahoogroups.com] På vegne af Douglas Crockford
      Sendt: 18. juni 2009 19:52
      Til: json@yahoogroups.com
      Emne: Re: SV: [json] new Date(NaN)





      --- In json@yahoogroups.com, "Jakob Kruse" <kruse@...> wrote:
      > "new Date()" normally produces a perfectly ok Date object representing the current date and time. Does your change to ES5 mean that "JSON.stringify([ <any date object> ])" will produce "[null]"? And if not, why should it refuse to stringify the current date and time in this manner when other dates and times give meaningful results?

      I meant exactly what I said. This only concerns new Date(NaN).


      [Non-text portions of this message have been removed]
    • joel.finch@ymail.com
      It might be worth noting that the Date constructor or Date.parse() fed an incorrectly formatted date string also gives a NaN-valued Date object, which is the
      Message 2 of 4 , Jun 18, 2009
      • 0 Attachment
        It might be worth noting that the Date constructor or Date.parse() fed an incorrectly formatted date string also gives a NaN-valued Date object, which is the more common cause.


        --- In json@yahoogroups.com, "Jakob Kruse" <kruse@...> wrote:
        >
        > Then apparently you didn't say what you meant. No offense, that was what I needed to clarify.
        >
        > "…that different implementations of JSON.stringify([new Date()]) do different things."
        >
        > /Jakob
        >
        >
        > Fra: json@yahoogroups.com [mailto:json@yahoogroups.com] På vegne af Douglas Crockford
        > Sendt: 18. juni 2009 19:52
        > Til: json@yahoogroups.com
        > Emne: Re: SV: [json] new Date(NaN)
        >
        >
        >
        >
        >
        > --- In json@yahoogroups.com, "Jakob Kruse" <kruse@> wrote:
        > > "new Date()" normally produces a perfectly ok Date object representing the current date and time. Does your change to ES5 mean that "JSON.stringify([ <any date object> ])" will produce "[null]"? And if not, why should it refuse to stringify the current date and time in this manner when other dates and times give meaningful results?
        >
        > I meant exactly what I said. This only concerns new Date(NaN).
        >
        >
        > [Non-text portions of this message have been removed]
        >
      • joel.finch@ymail.com
        I just ran the updated json2.js (2009-06-18) through my unit tests, and the valueOf() solution to the NaN Date issue fails for the epoch date (0 ticks ==
        Message 3 of 4 , Jun 19, 2009
        • 0 Attachment
          I just ran the updated json2.js (2009-06-18) through my unit tests, and the valueOf() solution to the NaN Date issue fails for the epoch date (0 ticks == false).
        • Douglas Crockford
          ... Fix. Thanks.
          Message 4 of 4 , Jun 29, 2009
          • 0 Attachment
            --- In json@yahoogroups.com, "joel.finch@..." <joel@...> wrote:
            >
            > I just ran the updated json2.js (2009-06-18) through my unit tests, and the valueOf() solution to the NaN Date issue fails for the epoch date (0 ticks == false).

            Fix. Thanks.
          Your message has been successfully submitted and would be delivered to recipients shortly.