Tell us what you are trying to do?
I created a page called Upcoming Events by Date. I want to add a datepicker that will allow users to search for events happening on a certain date or within a date range.
Is there any documentation that you are following?
https://toolset.com/course-lesson/creating-a-custom-search/
https://toolset.com/forums/topic/creating-front-end-filters/#post-919062
https://toolset.com/documentation/user-guides/views/date-filters/
https://toolset.com/forums/topic/view-with-a-datepicker-searching-on-custom-date-field-not-working/
Is there a similar example that we can see?
What is the link to your site?
hidden link
Hello, it depends to some extent on how the date is defined for each Event post. If the event date is stored in a single custom date field, then you can create a custom search View that includes a custom field filter based on that date field. If the event has a start date field and an end date field, you can add custom search filters for each date field. If you'd like for me to log in and take a closer look at how you have your dates structured, I'll need a login for your wp-admin area. Private reply fields are available here so you can share a login securely.
Okay I can see you have implemented a 3rd-party plugin to manage events, The Events Calendar. By default, these fields are not compatible with Toolset's front-end search filters, so the short answer is out-of-the-box, these systems aren't easily integrated. In order to create front-end filters using custom fields as filters, the custom date fields must be managed by Toolset Types. This plugin stores event dates in hidden custom fields that are not manageable by Toolset Types, so that's the first problem to overcome. The second problem to overcome is that the Event Calendar date fields are stored in a format that is not compatible with Toolset's date fields. Toolset Types date fields store dates in a format called Unix timestamps, and Views custom search filters are designed to work with dates stored in this format.
So if you want to create Views of Events from The Events Calendar and add front-end date filters, a bit of customization is required. You would have to create custom date field(s) in Toolset Types first, then use custom code to translate the Events Calendar dates into the proper format and store those translated dates in Types custom field values programmatically. Then Views would be able to add custom field filters based on those date fields. Another client shared some custom code they were able to use to programmatically set those custom field values: https://toolset.com/de/forums/topic/filter-date-in-view-with-data-from-pro-event-calendar/
Let me know if you have questions about that.
My issue is resolved now. Thank you!