Static option not working
Static option not working

Link to test case: https://live.datatables.net/liwonegi/1/edit?html,js,output
Debugger code (debug.datatables.net): (couldn't get it to work)
Error messages shown: No error as such, just incorrect rendering.
Description of problem: When I attempt to set the default rendering for dates as per https://datatables.net/examples/i18n/auto-render.html, it simply fails to render as a date. The original data is ISO 8601 and the output remains as ISO 8601. If I use column.render
, it works fine.
I'm new to DataTables, so assume I'm doing something wrong. But I can't figure out what.
This question has an accepted answers - jump to answer
Answers
DataTables doesn't have support for sub-second intervals built into to its ISO8601 formatting, which is what is tripping it up here. If I remove the
.000000
from your example, that the date renders as expected: https://live.datatables.net/liwonegi/2/edit .If you can update the output format of your date to match that, then that's the way to do it.
If you can't, you'll need to specify an exact format: https://datatables.net/examples/datetime/transform-moment.html .
Allan
Many thanks Allan. I'm glad it's such an easy fix. I'll tweak my source to remove the fractional seconds.