Hi, JSON[1] has no concept of dates. Objects, arrays, strings, numbers, nulls, that's it.
Some JSON parsers (such as json2.js[2]) have the concept of a "reviver" object that can pre-process keys and values during the parsing process (and similarly a "replacer" object for handling putting things into JSON in a way that they can be identified and revived by the reviver). Prototype's JSON processing doesn't have that feature (but again, you can use others that do). [1] http://json.org/ [2] http://www.json.org/js.html HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / com www.crowdersoftware.com On Mar 30, 4:26 am, eggie5 <egg...@gmail.com> wrote: > I have this arbitrary JSON string: > > [["2008-12-28",8],["2008-12-24",1],["2008-12-21",1],["2009-01-04",2], > ["2009-01-17",6],["2009-01-11",3],["2009-01-24",3],["2009-01-18",4], > ["2009-01-31",4],["2009-02-07",1]]" > > It is a serialized array from ruby using rail's to_json method. > > When I try to deserialize it the dates are note parsed and stay as > string. What's the deal? > > json_string.evalJSON() > > [["2008-12-28", 8], ["2008-12-24", 1], ["2008-12-21", 1], > ["2009-01-04", 2], ["2009-01-17", 6], ["2009-01-11", 3], > ["2009-01-24", 3], ["2009-01-18", 4], ["2009-01-31", 4], > ["2009-02-07", 1]] > > I want date objects returned after evalJSON call - how can I > accomplish this? -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.