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

Double quotes around ISO date string?

Expand Messages
  • geoffrey.mcgill
    Maybe I m just going crazy, but in a previous version of json.js (or maybe json2.js) did the .toISOString function wrap an extra set of (double quotes)
    Message 1 of 2 , Jul 4, 2008
    • 0 Attachment
      Maybe I'm just going crazy, but in a previous version of json.js (or
      maybe json2.js) did the .toISOString function wrap an extra set of ""
      (double quotes) around the converted date string?

      Was this removed at some point? just wondering why. Although, it never
      really made sense to me to begin with, so +1 for removing them. I'm
      just trying to get a confirmation on what is considered "correct" now.

      I apologize if this has already been discussed. I could not find
      anything on topic.
    • Douglas Crockford
      ... I think you are confusing toJSON with toJSONString. The toJSON method (which is supported by json2.js and is likely to be included in the next ECMAScript
      Message 2 of 2 , Jul 7, 2008
      • 0 Attachment
        --- In json@yahoogroups.com, "geoffrey.mcgill" <geoff@...> wrote:
        >
        > Maybe I'm just going crazy, but in a previous version of json.js (or
        > maybe json2.js) did the .toISOString function wrap an extra set of ""
        > (double quotes) around the converted date string?

        I think you are confusing toJSON with toJSONString. The toJSON method
        (which is supported by json2.js and is likely to be included in the
        next ECMAScript standard) allows an object to specify a value that
        will be serialized. The toJSONString method (which is no longer
        recommended) allows an object to return its own serialization string.
      Your message has been successfully submitted and would be delivered to recipients shortly.