Problems with Ultimate Date/Time Plugin

Problems with Ultimate Date/Time Plugin

RobotechRobotech Posts: 3Questions: 1Answers: 0

I am trying to get DataTables to sort two date columns properly and it just isn't working. I'm on IE11 and have followed the directions to the letter. The JS files for both moment and datetime-moment are on the server and the proper path is used to direct the page to them. Here is the code I have with the default order being set by one of the date fields: Table ID is reviewTable00.

$(document).ready( function () {
$.fn.DataTable.moment( 'M/D/YYYY' );
$('#reviewTable00').DataTable( {
"order": [4, 'desc'];
});

When I remove the code for the date/time moment formating, the page displays as expected. When I include it, none of the Javascript functions as it should. I'm still a neophite when it comes to javascript so I can't help but think I'm missing something simple. Switching to another browser isn't an option (long story). Thank you for your help.

Troy Lyman

This question has an accepted answers - jump to answer

Answers

  • bindridbindrid Posts: 730Questions: 0Answers: 119

    try changing $.fn.DataTable to $.fn.dataTable

  • RobotechRobotech Posts: 3Questions: 1Answers: 0

    Still have the same issue.

  • bindridbindrid Posts: 730Questions: 0Answers: 119
    Answer ✓

    My problem when away when I changed the d to lower case.

    On your include, moment should load first, datatables after that, then the plugin should load last.

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    If that isn't working for you, please link to a test case showing the issue so we can help to debug it.

    Allan

  • RobotechRobotech Posts: 3Questions: 1Answers: 0

    Bindrid and allan, I had the files loading as you mentioned. To me that just made logical sense. :D

    It wound up being the location of the plug in files on the server. They were in a subdirectory in relation to the Datatables files. Even though I had the path to load them correctly, it didn't work. Once moved to the same directory, all went well.

    Now I have a completely different issue but I'll start a new discussion on that.

This discussion has been closed.