Title: Date and Sorting doesnt work
Last modified: August 20, 2022

---

# Date and Sorting doesnt work

 *  Resolved [wpuser293](https://wordpress.org/support/users/wpuser293/)
 * (@wpuser293)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/date-and-sorting-doesnt-work/)
 * Hi Tobias, I am currently checking if i could use the tablepress plugin to list
   all the seminars. I want the table to be sorted by date as a standard value.
 * So I installed the datasorting plugin extension but the sorting only recognizes
   the first numbers. Then i tried to apply the following code in the customs field:
 * `"columnDefs": [{"type": "date-eu", "targets": [0,1]}]`
 * First two columns are “Date from” and “Date until”.
 * I added the table by following shortcode:
    `[table id=1 responsive=scroll datatables_fixedheader
   =top datatables_columnfilterwidgets=true datatables_columnfilterwidgets_exclude_columns
   =1,2,5,6,8 automatic_url_conversion=true automatic_url_conversion_new_window=
   true  /]`
 * So Plugin installed, tried to put in custom format and still it doesnt seem to
   work. Also tried some solutions from different forums like this one:
 * `"columnDefs": [ { "type": "date-eu", "targets": [ 0,1 ] } ], "order": [ [ 0,"
   asc" ] ]`
 * That should work but somehow doesnt. I am running out of ideas 😉
 * If that works I will for sure donate some money because the plugin is awesome!!
    -  This topic was modified 3 years, 9 months ago by [wpuser293](https://wordpress.org/support/users/wpuser293/).
      Reason: Code Editing

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/date-and-sorting-doesnt-work/#post-15934822)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * 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 [wpuser293](https://wordpress.org/support/users/wpuser293/)
 * (@wpuser293)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/date-and-sorting-doesnt-work/#post-15934855)
 * Hi Tobias, thanks for your message, can I send the URL to you in a private message
   as the homepage URL shouldnt be public yet?
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/date-and-sorting-doesnt-work/#post-15934867)
 * Hi,
 * thanks for the email with the link!
 * From what I can see, the cause for the problem is that these first two columns
   also contain empty cells — which the `date-eu` sorting algorithm does not understand
   correctly and runs into an error.
    Can you maybe fill all cells in these columns
   with a proper date?
 * Regards,
    Tobias
 *  Thread Starter [wpuser293](https://wordpress.org/support/users/wpuser293/)
 * (@wpuser293)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/date-and-sorting-doesnt-work/#post-15934880)
 * Hi Tobias, thanks for your reply, yes that might have been the problem. I filled
   all the items and the ones which are still in planning with a imaginary date.
   That would work. The thing is some seminars are still in the planning phase. 
   So the date would be something like “in planning”. Can i somehow add a placeholder
   which doesn’t mess up the sorting algorithm?
 * Thanks alot for your prompt reply!
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/date-and-sorting-doesnt-work/#post-15934900)
 * Hi,
 * unfortunately, that’s not possible with that algorithm at this time. I would 
   then recommend a slightly different approach, based on an extra (hidden) column.
   Please see [https://wordpress.org/support/topic/date-order-6/](https://wordpress.org/support/topic/date-order-6/)
   for more on this.
 * Regards,
    Tobias

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

The topic ‘Date and Sorting doesnt work’ 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/)

 * 5 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [3 years, 9 months ago](https://wordpress.org/support/topic/date-and-sorting-doesnt-work/#post-15934900)
 * Status: resolved