Format Date Column
Format Date Column
guicamarotto
Posts: 5Questions: 2Answers: 0
I want to format a column of date type. I tried use moment.js and datatables datetime render, but don't work.
Tried also the code below. Don't work too.
{
"targets": [3],
"sType": "date-ddmmyyyy"//<--- this one
}
My data is coming like this 2020-05-06T17:16:34.933 but I need something like that 06/05/202 (like DD/MM/YYYY)
Anyone knows a solution for that?
This discussion has been closed.
Answers
That combination works perfectly well if it's used correctly.
Please show all your code.
without format
error using that way
script section
If I change render to this, the error changes
Have you tried loading moment.js before dataTables?
There are lots of threads on the forum with that error. See if this one or this helps. If not please post a link to your page or a test case so we can help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
I have changed my approach guys, once I using .net mvc, I created a new property on my model to pass the formated date to my view. Thanks anyway.