I am just new to AJAX and JSON, JSON response etc many things are interleaved I don't know how these are working.
I just want to change the format of DATE in JSON response, I am getting response like this:
/Date(-62135596800000)/
I just want to change it into the HUMAN readable DATE format. HERE is the way how I am getting the values from database through DataTable using the columns from database and putting values into the view in c#.
$('#myDbTable')
.DataTable({
ajax: {
url: "@Url.Action("GetVouchers", "Vouchers")",
type: "GET",
dataType: "json",
dataSrc: 'DataSet',
},
"columns": [
{ "data": "FinancialYearName" },
{ "data": "CompanyName" },
{ "data": "BusinessUnitName" },
{ "data": "VoucherTypeName" },
{ "data": "Prefix" },
{ "data": "Code" },
{ "data": "VoucherDate" },
{ "data": "Status" }
],
"aoColumnDefs": [
{
"aTargets": [DataColumnsCount],
"mData": null,
"bSortable": false,
"mRender": function(data, type, fullRow) {
// console.log(fullRow);
return '<a class="btn btn-info btn-sm" href=#/' + fullRow["Id"] + '>' + 'Edit' + '</a>';
}
}
]
});
{ "data": "VoucherDate" } is the column which is showing the Date into the dataTable using the database column.
This is the image of OUTPUT for Date
I want to show it like 24 January, 2017.