Skip Navigation

[Résolu] Custom search with date range

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:

The thing I want to to is to filter based on a date range.

Solution:

You can follow our document to setup the custom date field filter:
https://toolset.com/documentation/user-guides/date-filters/

Relevant Documentation:

https://toolset.com/documentation/user-guides/date-filters/

This support ticket is created Il y a 6 années et 4 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Marqué : ,

Ce sujet contient 5 réponses, a 2 voix.

Dernière mise à jour par FrancoisJ6057 Il y a 6 années et 4 mois.

Assisté par: Luo Yang.

Auteur
Publications
#1071609
Modifier la vue ‹ Formation Mauricie — WordPress (1).png
Modifier la vue ‹ Formation Mauricie — WordPress.png
View  Filtre CPT   Formation Mauricie.png

Hi, I'm building a website right now in which we display some custom post types (educational programs). We want to offer a custom search option to our visitors. The can search by a keyword, of filter the results by some fields (is it offered online or in a class), is it offered during the day or in the evening...

The thing I want to to is to filter based on a date range. Each program have a "starting date". I want people to be able to see which courses are offered between two dates they can choose. I tried the "between" option, but it doesn't work. I only got one date picker. And, I get a messager telling me that my view hav filters that are missing from the form and that I might have deleted them.

What else do I have to do? Or am I misunderstanding something?

#1072464

Hello,

You can follow our document to setup the custom date field filter:
https://toolset.com/documentation/user-guides/date-filters/

For example, edit the view, in section "Query Filter", if you can not find it, click "Screen Option", and enable option "Query Filter", edit the date field filter according to above document, when inserting a query filter to test a date custom field you should use the UNSIGNED option

#1072582

Hi Luo,

Thanks for the reply. I managed to set, on admin side, a custom filter to show users results between two dates (ex.: from TODAY to 1 MONTH FROM NOW) that I choose. That's good if I want to show them, for example, which courses will be given in the next 30 days.

But, that's not was I'm looking for, unfortunately. What I'm looking to achieve, is that the users (front-end) can set two dates to see which courses are availables between X and Y. Is that possible?
I managed to insert a date picker option to filter courses availables to a given date or later, but not to the a "max date" (if I can say).

#1072587

If I can add : you show an example of a price range here (https://toolset.com/documentation/user-guides/front-page-filters/). That's kind of what I would like to do, but with dates...

#1074643

Yes, it is possible to filter a custom date field between two date-pickers, see the document I mentioned above:
https://toolset.com/documentation/user-guides/date-filters/#filtering-between-dates
section "Filtering Between Dates".

If you still need assistance for it, please provide a test site with the same problem, and fill below private message box with credentials , also point out the problem page URL and view URL, I need a live website to test and debug. thanks

#1074908
Modifier la vue ‹ Formation Mauricie — WordPress (2).png

Hi,
Thanks, I managed to make it works!

If I might suggest a modification in your documentation, you should provide a screenshots of the Search and Pagination section with an example of the code.

Thanks again!