I have following code
var res = from c in model.Data
select new object[] { c.Id, c.Time, c.Name };
this res variable is sent as json object.
Time is DateTime property. I'm fetching this json objects in the view like following
$(document).ready(function () {
$('#myDataTable').dataTable({
"bServerSide": true,
"sAjaxSource": "/Home/AjaxHandler",
"bProcessing": true,
"aoColumns": [
{ "sName": "ID",
"bSearchable": false,
"bSortable": false,
"fnRender": function (oObj) {
return '<a href=\"Details/' +
oObj.aData[0] + '\">View</a>';
}
},
{ "sName": "Time" },
{ "sName": "Name" }
]
});
});
Page is rendered with datetime fields like /Date(1346996934000)/
What is the best way to convert this, on the server side or in the view and how to do this?
Thanks