• Resolved tmbg

    (@tmbg)


    If I have a table with a row for every day of the year and sort it by date I can make it begin with either Jan. 1 or Dec. 31. Since today is Feb. 15, I would like events to be sorted beginning on Feb. 15 and automatically adjust every day. Is this possible?

    Another example if that’s not clear: I’m wanting to create a “Today in History” type of table. So I want the top row to be the current date (or if there’s no event on that day then use the next upcoming date) and then once that date has passed, I want it to cycle back to the bottom.
    Thanks.

    https://wordpress.org/plugins/tablepress/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    I see what you mean, but unfortunately, I’m not aware of an existing solution for this, sorry.
    This would likely require a custom sorting algorithm, which you’d need to develop. The TablePress Extension from https://tablepress.org/extensions/datatables-sorting-plugins/ could maybe serve as a starting point, as it shows how custom algorithms are added to DataTables. For more information, you could also check https://www.datatables.net/plug-ins/sorting/

    Regards,
    Tobias

    Thread Starter tmbg

    (@tmbg)

    I’ve played around with it and have a usable workaround with the Row Filter Date plugin using filter_date=”future” with only one compromise: past dates won’t be available for Search. Plus, every year I’ll have to adjust the year in the sorting column to the current year. So for the Declaration of Independence I have to put the date as 7/4/2016 instead of 7/4/1776 but it’s a hidden column so no big deal. Just noting it for anyone looking for a similar solution. Thanks.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    nice find! Yes, this Extension will help here, with those mentioned drawbacks.

    Best wishes,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Is it possible to sort by date starting w/ current date?’ is closed to new replies.