我想通过ajax加载一些数据并自动解析日期。jquery ajax请求的JSON日期格式
var url = "http://example.com/report_containing_dates.json"
jQuery.getJSON(url, function(data_containing_dates_and_strings){
console.log(date);
});
在我的JSON日期格式为“2012-09-28”(一般为从轨默认to_json),但jQuery的只是把这个字符串。日期需要用什么格式才能将jquery解析为日期?
样本响应:
{
"columns": [
["date", "Date"],
["number", "active_users"],
],
"rows": [
["2012-09-28", 120, 98, 60],
["2012-09-29", 127, 107, 63]
]
}