[Dojo-checkins] [dojo] #5726: dojo.toJson() doesn't serialize dates

dojo trac at dojotoolkit.org
Tue Jan 6 02:18:48 UTC 2009

#5726: dojo.toJson() doesn't serialize dates
 Reporter:  kriszyp      |        Owner:  alex  
     Type:  enhancement  |       Status:  new   
 Priority:  normal       |    Milestone:  future
Component:  General      |      Version:  1.0   
 Severity:  normal       |   Resolution:        
 Keywords:  json         |  

Comment(by peller):

 Yikes.  People have been wrestling with this problem for a while and while
 this may be the closest I've seen to a type-specific solution in JSON,
 well, there are a couple of reasons not to follow MS here.  One is that
 Crockford does have a solution offered in ES31, so this would diverge from
 the standard.  (We should probably consider supporting stringify/parse)
 MS does seem to rely on a real hack and not be generalizable, and by not
 using ISO format, it invites more timezone problems, etc.  I know it's
 unfortunate that the reviver/replacer system offered in ES31 ends up doing
 this more on a schema (particular named properties or property patterns)
 rather than a type, but that's because unfortunately JS doesn't have a
 native Date type, so it really just doesn't fit well into JSON to do it
 any other way.

Ticket URL: <http://bugs.dojotoolkit.org/ticket/5726#comment:25>
dojo <http://dojotoolkit.org/>
The Dojo UI Toolkit

More information about the Dojo-checkins mailing list