On Sat, Sep 19, 2009 at 00:15, Josh Kennedy <[email protected]> wrote:
> One thing I noticed is that neither the sling.json, nor the actual json
> library account for handling dates (ex: json.put("myDate", java.util.Date)).
> What is the preferred method for using a date type with json property
> descriptors? There are some json java implementations which will serialize
> java dates into the Date(xxx) in the json string. I haven't looked through
> the code for the json parser to see if theirs handles it properly, but
> through testing, I haven't gotten it to work with the sling json.
Sling will serialize a JCR Date object (java.util.Calendar) as String
in the (standard) Javascript/ECMA Date format, so that it can be
easily parsed on the client side:
new SimpleDateFormat("EEE MMM dd yyyy HH:mm:ss 'GMT'Z", Locale.US)
Regards,
Alex
--
Alexander Klimetschek
[email protected]