I am trying to create a view with a custom search that will filter by a Toolset Types date custom field.
My view displays a list of posts. Each post has a date assigned to it with the custom field I created. When I select a date using the parametric search, I want the display to only show posts that have a particular date assigned to it, e.g. show all posts with date 28th July.
I can't get this to work. How can I achieve this?
See: hidden link
Hello,
Your custom date field is using setting "Input date and time", so it can save the time value, like this:
Tuesday 24 July, 19:00
But in the Views custom search form, the date filter can only pass the date value, for example: Tuesday 24 July
so those values aren't equal, and it won't be able to work as you expected.
I suggest you setup the filter using BETWEEN function, so when user search the date as below:
Between Tuesday 24 July and Tuesday 25 July
Then they will get the expected results.
see our document:
https://toolset.com/documentation/user-guides/date-filters/#filtering-between-dates
Hi. Thanks for the advice.
Could you please provide a bit more detail about how to set this up?
I have got as far as setting the between PAST DAY and FUTURE DAY - see screenshot:
hidden link
What goes in the other associated boxes?
Does the user have to choose the start and end days?
You need to setup two date-pickers,:
"Start date" and "End date"
For example, edit your view, find the section "Search and Pagination", if you can not see it, you can enable it by this: click "Screen option", option "View purpose" choose "Full custom display mode"
click button "New filter", add a filter on your custom date filter, see screenshot: between.JPG
More help:
Building Custom Searches for Any Content Type
https://toolset.com/documentation/user-guides/front-page-filters/