I have a frontend app and I have a column with date and time and I would like to format it. The npm module used for the table is datatables.net-dt
Here is the code:
$(document).ready(function() {
var table = $('#example').DataTable({
responsive:true,
data:res.mesaje,
buttons:true,
destroy:true,
columns: [
{data:'datetime'},
{defaultContent:'<button id="buton123">Download</button>'}
]
})
I tried with moment.js using the function of moment formatting after {data:moment...etc.. but it shows nothing in the date time column. The datetime format that i get from the API is 202011100707 and I would like to format it to 2020/11/11 10:10 something like that. Please help