var date = [
{"riqi":"2017-10-19","xinpai_db":"8","xinpai_gz":"8"},
{"riqi":"2017-10-20","xinpai_db":"3","xinpai_gz":"0"},
{"riqi":"2017-10-21","xinpai_db":"0","xinpai_gz":"0"}
]
for(var i=0i<date.lengthi++){
date[i]['riqi']= date[i]['riqi'].replace(/-/g,"/")
}
在MVC应用程序中,服务器端用C#将日期转为Json格式:客户端还原日期的方法:
new Date(parseInt(WriteTime.substr(6)))