The JSON format doesn't define a format for date.
http://www.json.org/

You'd need to use either a string or a number, and that decision  
should be made by the client and/or the server, not the serlializer.   
(I haven't checked the code to figure out whether it treats dates as  
an object (bleh), string, or number, but I'd suggest this is really  
the end programmer's problem, not Prototype's. Or, use the standard  
unix timestamp, UTC. Most languages can handle he UTC timestamp  
without special parsing functions.)

After reflecting on my response, above, I figured you were probably  
aware of the JSON limitation, and simply disagree with me regarding  
the library's responsibility in this manner.  =)

Cheers,


TAG

On Mar 8, 2007, at 2:43 PM, Rick Olson wrote:

> On Feb 22, 7:51 pm, "Tobie Langel" <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> I've committed my work on JSON to the new ajax branch Mislav just set
>> up (thanks!).
>
> How are you planning to do date serialization for json?  I did some
> work in Rails and noticed it used "Thu Mar 08 15:41:36 CST 2007",
> which is no good.  I wrote a json plugin for rails that uses the fjson
> gem to parse incoming json, and uses the xml schema time format
> instead.  It's what we use for XML and is easy to parse in any
> language.  A serialized date would then be:
> "2007-03-08T15:43:22-06:00"
>
> http://svn.techno-weenie.net/projects/plugins/json_for_rails/lib/ 
> json_for_activesupport.rb
>
> rick
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to