• Resolved pedromfs

    (@pedromfs)


    Hi,
    I have specific use case that is not supported with the current implementation of dates filtering.

    I need to display 2 lists of posts for one of my clients:

    • All future posts
    • All posts from the last month

    The “All posts from the last month” I can easily achieve with this plugin, but I can’t seem to be able to achieve the “All future posts” part.

    The current date filter allows us to use before, after and between filters, but all of those are based on a specific date you select on the calendar.

    How about, alternatively from selecting the date on the calendar, I could also select “Today” and that would be a dynamic date always based off the current day.

    In order to achieve the use case, I actually had a custom version of this plugin with this piece of code in the process_date_range function:

    case 'in-future':
    return array(
    'after' => 'today'
    );

    However, I got a bit tired of adding it after every each plugin update.

    Let me know if something like this it would be possible, or if you have any other idea on how I could solve this “future posts” use case ??

    Thanks and keep up the awesome work!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Ryan Welcher

    (@welcher)

    Hello and thanks for using AQL!

    This is an interesting use case. I’m not sure I understand the why/how of showing posts that are posted in the future ( are you a time traveller? ?? ) but either way it does show the need to be able to set dynamic start and end points for dates.

    I am working on the best way to integrate this into AQL so leave it with me!

    Thread Starter pedromfs

    (@pedromfs)

    Thank you for the reply @welcher !
    Yes, I’m a traveller from the future. I can tell you that everyone here is using AQL!! ^^

    So, my use case is very straightforward ?? My client uses wordpress to display an agenda of events, some of them in the future. Instead of going through the metakey-way, I’ve decided to ensure future posts are published and use the post date as the event date. This was easier from a usability standpoint for the client.

    Looking forward to hear from you. Thanks again for the amazing work!

    Plugin Author Ryan Welcher

    (@welcher)

    I have a pull request ready for this feature. It will be part of the next release.

    Thread Starter pedromfs

    (@pedromfs)

    Super! Thank you very much @welcher !

    Plugin Author Ryan Welcher

    (@welcher)

    This was release today at part of v4.0.0!

    I’m going to close this thread but let me know if you run into any issues.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.