Title: Tablepress sorting dates
Last modified: September 5, 2017

---

# Tablepress sorting dates

 *  Resolved [J.Roos](https://wordpress.org/support/users/jroos/)
 * (@jroos)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/tablepress-sorting-dates/)
 * On our website [http://www.pijnacker-noord.nl](http://www.pijnacker-noord.nl)
   we have two tables with dates: “Agenda” on the home page and “dossiers” under“
   Renovatie wijk”. Our preferred date annotation is dd-mmm-yyyy e.g. 12-sep-2017.
 * I tried the phrase “columnDefs”: [ { “type”: “date-eu”, “targets”: [ 1 ] } ] 
   on the “Custom Commands” text field in the “Features of the DataTables JavaScript
   library” section on the “Edit” screen of “Dossiers”.
    The date column is the 
   second column. Adding this phrase inhibits sorting the date column by the user.
   This however does not solve the sorting problem for “dossiers”.
 * On the home page we use the responsive table plugin in the collapse mode for 
   table “Agenda”. Adding the phrase “columnDefs”: [ { “type”: “date-eu”, “targets”:[
   0 ] } ] does not work either but corrupts the layout of the “Agenda”table as 
   well. You can see the effect on the homepage of [http://www.wp-n1.nl](http://www.wp-n1.nl)(
   our developer site). For your information: Table “Agenda” has two hidden colums:“
   Author” and “date of creation of the event”. There is no need to sort this last
   column.
 * I followed the instructions of the note “Sorting or other JS functions are not
   working” but I found no noticeable clues.
 * We welcome your advice.
 * Regards Jaap Roos
 * Debug information:
    · Website: [http://www.pijnacker-noord.nl](http://www.pijnacker-noord.nl)·
   TablePress: 1.8 · TablePress (DB): 34 · TablePress table scheme: 3 · Plugin installed:
   2015/10/07 10:21:59 · WordPress: 4.8.1 · Multisite: no · PHP: 5.6.31 · mysqli
   Extension: true · mySQL (Server): 5.5.5-10.0.29-MariaDB-cll-lve · mySQL (Client):
   mysqlnd 5.0.11-dev – 20120503 – $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a
   $ · ZIP support: yes · UTF-8 conversion: yes · WP Memory Limit: 40M · Server 
   Memory Limit: 256M · Magic Quotes: off · WP_DEBUG: false · WP_POST_REVISIONS:
   true
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ftablepress-sorting-dates%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/tablepress-sorting-dates/#post-9471448)
 * Hi,
 * thanks for your question, and sorry for the trouble.
 * Unfortunately, neither of the available sorting algorithms for dates supports
   the format “12-sep-2017”.
 * If you want to use that, you could try the approach of adding another hidden 
   column that has the machine-readable format mm/dd/yyyy. Then, you can instruct
   the DataTables JS library to use that hidden column for the sorting. That’s explained(
   for a similar sorting problem) at [https://wordpress.org/support/topic/sorting-function-with-images/](https://wordpress.org/support/topic/sorting-function-with-images/)
   and [https://wordpress.org/support/topic/consolidating-columns-without-changing-sorting-options/](https://wordpress.org/support/topic/consolidating-columns-without-changing-sorting-options/)
 * Regards,
    Tobias
 *  [aparask](https://wordpress.org/support/users/aparask/)
 * (@aparask)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/tablepress-sorting-dates/#post-9505817)
 * Sorry,
    I have the same problem (date of type dd/mm/yyyy e.g.31/12/2016) an I
   cannot sort the dates. What I can do?
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/tablepress-sorting-dates/#post-9505882)
 * Hi,
 * as you also asked this at [https://wordpress.org/support/topic/sorting-a-column-by-a-dd-mm-yyyy-date-format/#post-9505881](https://wordpress.org/support/topic/sorting-a-column-by-a-dd-mm-yyyy-date-format/#post-9505881),
   I replied there 🙂
 * Regards,
    Tobias

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

The topic ‘Tablepress sorting dates’ 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/)

 * 3 replies
 * 3 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [8 years, 8 months ago](https://wordpress.org/support/topic/tablepress-sorting-dates/#post-9505882)
 * Status: resolved