rsanchez/json — Issue #9: entry_date timestamps are returned as string
Author: GDmac
Created: 2011-12-24 15:51:39+00:00
State: open

Rob,
It took me some time to figure out why dates weren't being parsed by a javascript calendar.
I followed the example from your readme new Date(data[i].entry_date), but, seems that (at least in Google-Chrome) doesn't work somehow if the timestamp in the json object is a string;

// timestamp as string
var data = { entry_date : "1325602858000" }

// returns NaN
var entryDate = new Date( data.entry_date );
entryDate.getTime()

The long route is to return date type fields as integer
(should an empty expiration_date be 0 ?)
The quick solution is to typecast it in javascript

// works by typecasting to number
var entryDate = new Date( Number(data.entry_date) );
entryDate.getTime()

What are your thoughts on this?