Home > OS >  Render date on datatables
Render date on datatables

Time:10-21

When i try to display the date on datatables by ajax.

The date value become /Date(1665507600000)/ and then I try to render it with

render: $.fn.dataTable.render.moment("YYYY-MM-DDTHH:mm:ss.SSSSZ", "DD/MM/YYYY")

the value of the date become "Invalid date".

The date value in SQL is "2022-10-12 00:00:00.000"

It was display fine when I use HTML Action.

I appreciate every help.

CodePudding user response:

Use this render instead

render: DataTable.render.datetime('DD/MM/YYYY')
  • Related