How to get max or recent date on 2nd Column
How to get max or recent date on 2nd Column

I'm looking for getting maximum or most recent date on datatable (column 2) as it have list of date. How do I do that?
I'm looking for getting maximum or most recent date on datatable (column 2) as it have list of date. How do I do that?
Answers
It is possible to use the
order
option ofselector-modifier
objects to get data, as if it had been ordered in the table. So assuming your date data has been detected as dates, you could do:Allan
thank you for this. so I assume below that I need return latest date such as:
let test1 = $("#person-history")
.cells("*", 1, { order: 1 })
.data()
.toArray()
.reverse()[0];
alert(test1);
I've tried this and it return error.
cells()
is a DataTable API method, so if you don't already have an API instance, you could try:Allan