• Resolved pdbooth

    (@pdbooth)


    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

    (@tobiasbg)

    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/

    Regards,
    Tobias

    Thread Starter pdbooth

    (@pdbooth)

    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

    (@tobiasbg)

    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.