Title: Sort on Dates
Last modified: February 3, 2019

---

# Sort on Dates

 *  Resolved [pdbooth](https://wordpress.org/support/users/pdbooth/)
 * (@pdbooth)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/sort-on-dates/)
 * Hello,
 * I have created a simple table the first column of which contains dates in the
   form: Day dd mmm yyyy, e.g. Sun 03 Feb 2019. How do I sort the entries so the
   eariest date is at the top of the table?

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/sort-on-dates/#post-11164146)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * Unfortunately, this is not a date format that is directly recognized by the JavaScript
   library. Your best chance here is the approach with a hidden column that has 
   the date in a different format (`mm/dd/yyyy`) in it, similar to the approach 
   from [https://wordpress.org/support/topic/date-order-6/](https://wordpress.org/support/topic/date-order-6/)
 * Regards,
    Tobias
 *  Thread Starter [pdbooth](https://wordpress.org/support/users/pdbooth/)
 * (@pdbooth)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/sort-on-dates/#post-11172821)
 * Many thanks, that solved my problem. I have a related query – having now sorted
   on the hidden date column, the rows are now all sorted in the correct order (
   earliest date first) but they have all been shifted to the bottom of the table
   with blank rows above. Can I arrange these rows with earliest row at the top,
   next earliest in the next row and so on with blank rows below the last (latest
   date) entry?
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/sort-on-dates/#post-11174408)
 * Hi,
 * not directly, I’m afraid. The sorting algorithm basically thinks that the empty
   rows are even “earlier” than your earliest date.
    One trick could be to simply
   add a very late date (like `12/31/2999`) into the hidden column for the empty
   rows.
 * Regards,
    Tobias

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

The topic ‘Sort on 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
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [7 years, 3 months ago](https://wordpress.org/support/topic/sort-on-dates/#post-11174408)
 * Status: resolved