Using DataTable.datetime('DD/MM/YY');
Using DataTable.datetime('DD/MM/YY');
csyu
Posts: 14Questions: 2Answers: 1
Error messages shown:
TypeError: i.datetime is not a function
Description of problem:
I'm am looking to have Datatables render a datetime column so that I can sort it correctly.
When I add DataTable.datetime('DD/MM/YY');
to my Vue page, I get the error above.
My full imports:
import moment from 'moment';
import DataTable from 'datatables.net-vue3';
import DataTablesLib from 'datatables.net';
import 'datatables.net-select';
import 'datatables.net-responsive';
DataTable.use(DataTablesLib);
DataTable.datetime('DD/MM/YY');
Thank you
Answers
It is a method of the
datatables.net
package. TryDataTablesLib.datetime
.Allan
Thanks Allan.
Not sure why it's still not working. I now have this code:
But I get the warning via a browser alert:
Moment.js is loaded properly on the page because I can do this successfully:
Any thoughts on if the DataTablesLib has another dependency to make this work?