Title: sort by date
Last modified: August 22, 2016

---

# sort by date

 *  Resolved [martin6135](https://wordpress.org/support/users/martin6135/)
 * (@martin6135)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/sort-by-date-6/)
 * Hi,
    i have problem with sorting table by date. I need sort table by first column.
 * I tried custom command:
    “aoColumnDefs”: [ { “sType”: “date-eu”, “aTargets”: [
   0 ] } ]
 * I tried different formats:
 *     ```
       dd.mm.yyyy
       dd/mm/yyyy
       ```
   
 * but nothing works:( i don’t know why. can you help me? Thanks
 * [https://wordpress.org/plugins/tablepress/](https://wordpress.org/plugins/tablepress/)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/sort-by-date-6/#post-5884892)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * Did you install the DataTables Sorting Plugins Extension from [http://tablepress.org/extensions/datatables-sorting-plugins/](http://tablepress.org/extensions/datatables-sorting-plugins/)
   that is necessary for this to work?
    Can you please post a link to the page with
   the table where this problem happens, so that I can take a direct look? Thanks!
 * Regards,
    Tobias
 *  Thread Starter [martin6135](https://wordpress.org/support/users/martin6135/)
 * (@martin6135)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/sort-by-date-6/#post-5884900)
 * Hi,
 * thank you for your answer.
    link to my site where this problem happens: [http://kniznicapezinok.sk/zmluvy/](http://kniznicapezinok.sk/zmluvy/)
 * I have installed sort plugin, but still don’t works.
    Thank you for your support
 *  [dduet](https://wordpress.org/support/users/dduet/)
 * (@dduet)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/sort-by-date-6/#post-5884967)
 * Hi,
 * I am having a similar problem. Cannot sort by date or $ value, despite having
   the csv setup correct and the extension installed. Here is the link: [http://benchmarkbusiness.com.au/recent-business-sales/](http://benchmarkbusiness.com.au/recent-business-sales/)
 * I also find that I cannot edit rows etc once setup, when I click save nothing
   happens.
    Please advise.
 * Thanks,
 * Pete
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/sort-by-date-6/#post-5885016)
 * Hi,
 * martin6135:
    From what I can see, sorting is turned off for that table? Also,
   I don’t see the “Custom Command” that you posted in the page?
 * dduet:
    You will also have to add a “Custom Command” here, so that the dates 
   are recognized. The problem in the price column is that the prices there sometimes
   also contain extra text (like “+ stock”). Please try adding this to the “Custom
   Commands” textfield on the “Edit” screen of the table:
 *     ```
       "columnDefs": [ { "type": "date-eu", "targets": [ 0 ] }, { "type": "formatted-num", "targets": [ 3 ] } ]
       ```
   
 * Regards,
    Tobias
 *  Thread Starter [martin6135](https://wordpress.org/support/users/martin6135/)
 * (@martin6135)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/sort-by-date-6/#post-5885019)
 * Hi,
    thank you for your answer.
 * I wanted sorted table in edit mode, by clicking on arrow above column A. Sorting
   on page working very well!
    I export this table and edit it on my PC = resolved
   I have another question. Can I allow sorting table on page only by the firt column?
   Thank you
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/sort-by-date-6/#post-5885026)
 * Hi,
 * ah, ok. The sorting algorithms on the “Edit” screen are only very basic. Exporting
   and then editing the file on the PC is the best way here.
 * To allow sorting only on the first columns, you’ll have to turn it off for the
   other columns, by extending the “Custom Command” to
 *     ```
       "columnDefs": [ { "type": "date-eu", "targets": [ 0 ] }, { "orderable": false, "targets": [ 1, 2, 3, 4 ] } ]
       ```
   
 * Regards,
    Tobias
 *  [dduet](https://wordpress.org/support/users/dduet/)
 * (@dduet)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/sort-by-date-6/#post-5885113)
 * Hi Tobias,
 * Have input that code, however has made no difference.
    Cheers, Pete
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/sort-by-date-6/#post-5885120)
 * Hi Pete,
 * ah, I found the reason for the problems on your site: Your theme is also loading
   a copy of the DataTables JS files (from /wp-content/themes/realexpert/js/jquery.
   dataTables.min.js). However, it’s loading an old version (version 1.9.4), while
   TablePress brings version 1.10.3.
    As the copy that the theme brings is loaded
   first, that’s the one that will be used. Now, unfortunately, that older version
   uses a different code syntax, so that the JS commands that TablePress uses natively(
   as well as the “Custom Commands”) don’t work. This is for example also the reason
   why you are still only getting the pagination with 10 rows, although you have
   set the value to 50.
 * The best fix here would be to stop the theme from loading DataTables at all, 
   as you are probably not using other tables besides those from TablePress. An 
   alternative would be to replace the content of that JS file from above with the
   content of the DataTables JS file from TablePress. That way, everything should
   work fine (but you’d still be loading the same content twice).
 * Regards,
    Tobias

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘sort by date’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

 * 8 replies
 * 3 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/sort-by-date-6/#post-5885120)
 * Status: resolved