Skip Navigation

[Gelöst] How to filter dates in a view

This support ticket is created vor 2 Jahre, 10 Monate. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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: Africa/Casablanca (GMT+00:00)

This topic contains 5 Antworten, has 2 Stimmen.

Last updated by fred-r.M vor 2 Jahre, 10 Monate.

Assisted by: Jamal.

Author
Artikel
#2071567

Tell us what you are trying to do? We are having a custom post type "Tour Dates". The main field we are using there is Tour Date Field (Date format). The sorting in the view is working so far fine.

But now we like to show all dates starting today until the future. Having the filter this way:

- Tour Date Field is a DATE greater than NOW() - shows us the very first record.
- Tour Date Field is a DATE greater than TODAY() - shows us the very first record.

It seems as this filter isn't working as it should be...

Is there any documentation that you are following? https://toolset.com/documentation/user-guides/views/filtering-views-query-by-date/

Is there a similar example that we can see? hidden link

What is the link to your site? hidden link

#2071745

Jamal
Supporter

Languages: Englisch (English ) Französisch (Français )

Timezone: Africa/Casablanca (GMT+00:00)

Hello and thank you for contacting the Toolset support.

If I understand correctly, you wouldn't expect to get the first 2 posts in this screenshot hidden link right?
Would you allow me temporary access to check how the view and filters are setup? Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

#2072371

Jamal
Supporter

Languages: Englisch (English ) Französisch (Français )

Timezone: Africa/Casablanca (GMT+00:00)

Thank you for the credentials. The view did not have any existing query filters as you can see in this screenshot hidden link Therefore, it will return all the posts that have a value for the field tour-date-field, because it is used for ordering.

I added a query filter on the "Tour Date Field" field and it worked as expected. The query filter needs to compare values as numbers. Check this screenshot hidden link
And this screenshot of the results hidden link

I hope this helps. Let me know if you have any questions.

#2072629

Dear Jamal

Okay, great. I didn't know what to put in, so far. Is there a documentation I can follow - in the future?

Regards

#2072631

Jamal
Supporter

Languages: Englisch (English ) Französisch (Français )

Timezone: Africa/Casablanca (GMT+00:00)

Thank you! I am glad I could help.

Besides of the article that you have shared in your first message, we have this other article:
- https://toolset.com/documentation/user-guides/views/date-filters/

Unfortunately, all our documentation efforts are now moved toward Blocks editor. If you have any questions about the legacy views, just open a chat or a ticket here and we'll do our best to help.

For support rules, we are able to handle only one issue at a time. This helps us to bring you a better service and also helps other users to find all the information here exposed. If you think that your initial question has been answered, please mark this ticket as resolved and open a new chat or ticket for any other question/request.

All the best,
Jamal

#2074179

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.