Filtering on Date Range

Forums Forums Search & Filter Pro Filtering on Date Range

Viewing 3 posts – 1 through 3 (of 3 total)
  • Anonymous
    #15143

    Hi Ross,

    I have an issue similar to this post:

    https://support.searchandfilter.com/forums/topic/how-to-filter-events-that-occur-within-a-date-range/

    I have four custom fields (created using ACF) – two that hold the start and end dates of a “booking window” and two that hold the start and end dates for a “travel window”. These are stored as separate fields so that we can perform a query on the ‘end’ dates to determine if a deal should be displayed (if it is not past its booking window end date), and also to format the display of the dates (and a few other reasons). All dates are stored as yymmdd.

    Now I need to add a module to the Filter so that site visitors can enter their travel dates (in two fields, one for ‘check in’ and one for ‘check out’) and have the results filtered so that only those deals for which the check-in and check-out fall within the two date fields for travel-date-start and travel-date-end, but when I enter dates in the two new fields, the filtering returns no results, even when I know there are a lot that it should find.

    I think what is happening is that it is looking for an exact match, not a ‘greater than’ comparison – so if the date entered for check-in just happens to match the start date of the travel window, it finds a match, but if it is after the start date of the travel window, it does not match.

    I hope this makes sense….can you suggest any workarounds?

    Ross Moderator
    #15144

    Hey Trisha

    I’m afraid there are no easy workarounds for that, you’d really have to dig in to the code – its on my todo list so hope to get it added in the next 1 – 2 months.

    Thanks

    Anonymous
    #15146

    OK, thanks Ross, I’ll keep watching for that update. 🙂

Viewing 3 posts – 1 through 3 (of 3 total)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.