csv to html automatic reverse chronological sort

Not sure where to begin, I am using a CSV to Html table template by Derek Eder https://github.com/derekeder/csv-to-html-table.
I'm using it to display a list of events that have happened, I would like to see if there is a way to make the default sort for the java app be reverse chronological order instead of chronological order. I know there are multiple sort functions, however since I am automatically refreshing every 10 seconds and it would be handy to have the results sorted the way I would like automatically.
I don't have any experience in java so any help would be greatly appreciated.
LVL 1
csePixelatedAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CEHJCommented:
Done in 100% JavaScript.
(Not a Java question)
1
Chris StanyonWebDevCommented:
OK. Firstly, this is Javascript - not Java. They're completely different languages :)

Having a quick peak at the docs, it looks like it's backed up by the DataTable plugin and there is an option to set the plugin settings. The setting for the default sort order in DataTables is :

{ "order": [[ 3, "desc" ]] }

The 3 is the zero-based index of the column you want to sort on.
Just add that to your init script:

<script>
  CsvToHtmlTable.init({
    csv_path: 'yourData.csv', 
    element: 'table-container', 
    allow_download: true,
    csv_options: {separator: ',', delimiter: '"'},
    datatables_options: {"paging": false, "order": [[ 3, "desc" ]] }
  });
</script>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
csePixelatedAuthor Commented:
My apologies, yes Javascript is what i meant, just tried Chris Stanyon comment  adding "order": [[ 3, "desc" ]]  in the database options, now i get no results.
0
csePixelatedAuthor Commented:
i had forgotten the comma, it shows data but not in not in reverse chronological order my dates/times look like 2/19/2018 9:29:43 AM that is how i want them. however it's still oldest to newest?
0
csePixelatedAuthor Commented:
never mind i was looking at the wrong page, my desktop has too much going on, ty Chris Stanyon
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.