Title: Sorting By Date
Last modified: August 22, 2016

---

# Sorting By Date

 *  Resolved [RGOnline](https://wordpress.org/support/users/rgonline/)
 * (@rgonline)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/sorting-by-date-4/)
 * Hi Tobias, im sure i submitted this last week but i cant seem to find it.
 * Im having trouble with sorting by date – i saw your suggestion of using the tablepress-
   row-filter-date plugin which doesnt seem to have changed anything.
 * An example table is here- [http://rg-onlinesolutions.co.uk/racecourse/fixtures-in-full/](http://rg-onlinesolutions.co.uk/racecourse/fixtures-in-full/)–
   what do i need to do to enable people to sort by date?
 * Thanks
 * [https://wordpress.org/plugins/tablepress/](https://wordpress.org/plugins/tablepress/)

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/sorting-by-date-4/#post-5405396)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * That Extension is unrelated to the sorting that the user performs, so it won’t
   be helpful here.
 * The issue here basically is that you are using the European date format, for 
   which the JS sorting library does not have an algorithm by default. That is however
   available after installing the TablePress Extension from [http://tablepress.org/extensions/datatables-sorting-plugins/](http://tablepress.org/extensions/datatables-sorting-plugins/)
 * Regards,
    Tobias
 *  Thread Starter [RGOnline](https://wordpress.org/support/users/rgonline/)
 * (@rgonline)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/sorting-by-date-4/#post-5405402)
 * Brilliant thanks, i srill need the other plugin as id like to only display today
   and future dates too.
 * Great help
 * Cheers
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/sorting-by-date-4/#post-5405434)
 * Hi,
 * no problem, you are very welcome! 🙂 Good to hear that this helped!
 * Best wishes,
    Tobias
 * P.S.: In case you haven’t, please [rate TablePress](https://wordpress.org/support/view/plugin-reviews/tablepress)
   here in the plugin directory. Thanks!
 *  Thread Starter [RGOnline](https://wordpress.org/support/users/rgonline/)
 * (@rgonline)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/sorting-by-date-4/#post-5405487)
 * done, thanks Tobias
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/sorting-by-date-4/#post-5405495)
 * Hi,
 * thanks! I really appreciate it!
 * Best wishes,
    Tobias
 *  [Valentin](https://wordpress.org/support/users/vbachem/)
 * (@vbachem)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/sorting-by-date-4/#post-5405658)
 * I have problems sorting my tables by date: [http://theatergemeinde-heidelberg.de/vorstellungstermine/](http://theatergemeinde-heidelberg.de/vorstellungstermine/)
 * I’ve already installed the datatables sorting plugin.
    I use tablepress 1.4
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/sorting-by-date-4/#post-5405659)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * We might have to explicitly tell the DataTables JS library to use European date
   sorting. For that, please add this to the “Custom Commands” (“Eigene Befehle”)
   text field on the “Edit” screen of the table:
 *     ```
       "aoColumnDefs": [ { "sType": "date-eu", "aTargets": [ 1 ] } ]
       ```
   
 * The `1` in the code indicates that the dates are in the second column (counting
   starts with 0).
 * Regards,
    Tobias
 *  [Valentin](https://wordpress.org/support/users/vbachem/)
 * (@vbachem)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/sorting-by-date-4/#post-5405667)
 * Hi Tobias,
 * thanks for the code. It is working to sort in frontend for the visitor. But when
   I edit the table I can’t sort it by date.
 * Do you have a hint how to solve that?
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/sorting-by-date-4/#post-5405674)
 * Hi,
 * yeah, unfortunately, this will only add the sorting to the frontend. The reason
   for this is that the “Edit” screen uses a different JavaScript library for the
   sorting. Unfortunately, that one is not as powerful as the library that is used
   on the frontend, and it can not be extended with custom sorting algorithms 🙁
   Now, I do have plans to change this in the future, when I rewrite the “Edit” 
   screen for more features and better performance, but that will still take some
   time.
    Meanwhile, I can only suggest to maybe do the sorting not directly in 
   TablePress, but e.g. in Excel (if it’s more data than what can be sorted manually).
   This means, that you could export the table to a CSV file, open that in Excel,
   sort the data, and then re-import the table into TablePress, choosing to replace
   the existing table.
 * Regards,
    Tobias
 *  [Valentin](https://wordpress.org/support/users/vbachem/)
 * (@vbachem)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/sorting-by-date-4/#post-5405675)
 * Thank you for the explanation.
 * How can I specify that the table for the user is always sorted by the date?
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/sorting-by-date-4/#post-5405676)
 * Hi,
 * sure, no problem! The best way would probably be to sort the table beforehand(
   using that Excel approach). You could however also tell the JS sorting library
   to perform an initial sorting when the page is loaded. For that, extend the “
   Custom Command” from above to
 *     ```
       "aoColumnDefs": [ { "sType": "date-eu", "aTargets": [ 1 ] } ], "aaSorting": [[1,'asc']]
       ```
   
 * Regards,
    Tobias
 *  [Valentin](https://wordpress.org/support/users/vbachem/)
 * (@vbachem)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/sorting-by-date-4/#post-5405677)
 * Thank you for helping me with that!
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/sorting-by-date-4/#post-5405678)
 * Hi,
 * no problem, you are very welcome! 🙂 Good to hear that this helped!
 * Best wishes,
    Tobias
 * P.S.: In case you haven’t, please [rate TablePress](http://wordpress.org/support/view/plugin-reviews/tablepress)
   here in the plugin directory. Thanks!

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

The topic ‘Sorting 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/)

 * 13 replies
 * 3 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/sorting-by-date-4/#post-5405678)
 * Status: resolved