Skip Navigation

[Resolved] Date comparison error same as post-1116145

This thread is resolved. Here is a description of the problem and solution.

Problem:

After updating Toolset, Views and Events Calendar this comparison is no longer working. It displays all the events.

It is working when I change filter to manual date:
Select items with field: _EventStartDate is a DATE greater than or equal 2018-10-01 00:00:00

After adding the code as solution from suport to functions.php it still is not working. The view keeps showing all dates (meaning the past dates also)

Solution:

This is a conflict issue with:

Woocommerce > Cart Reports (Ultimatewoo Version: 1.5.6 with Cart Reports 1.1.20)

Relevant Documentation:

This support ticket is created 6 years, 1 month ago. 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.

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)

This topic contains 5 replies, has 3 voices.

Last updated by willemP 6 years ago.

Assisted by: Luo Yang.

Author
Posts
#1121504

Like in post 1116145, I'm usings views to generate list of forthcoming events.

In query filter I used following:
Select items with field: _EventStartDate is a DATE greater than or equal TODAY()

After updating Toolset, Views and Events Calendar this comparison is no longer working. It displays all the events.

It is working when I change filter to manual date:
Select items with field: _EventStartDate is a DATE greater than or equal 2018-10-01 00:00:00

After adding the code as solution from suport to functions.php it still is not working. The view keeps showing all dates (meaning the past dates also)

Link to a page where the issue can be seen: All pages in the hovering the menu "Workshops & Reizen"

I expected to see: Only the dates in the future

Instead, I got: ALL dates from the past also

#1121920

This one?
https://toolset.com/forums/topic/date-comparison-error-with-tribe-events-calendar-after-update/
https://toolset.com/forums/topic/date-comparison-error-with-tribe-events-calendar-after-update/#post-1116301

That solution is a workaround an issue created by the events calendar plugin, not Toolset, I would not recommend interpreting this as a fix, since there is nothing broken in Toolset, and Events Calendar chose a certain format for dates.

The request to the Events calendar could be to allow other time formats.

Another issue is, that probably you face this issue:
https://toolset.com/documentation/user-guides/date-filters/
Previously, we recommended filtering by date.
It should instead be by NUMBER.

Can you try that and see if then this query works?
(It will still need to have some custom code that makes the Events date field a timestamp)

#1122269

ok. I tried this. No result.

I think I had a cache issue.

So to start from scratch I created a new test page where I added a query >> Posttypes >> Events and just a simple basic view with some of the Events calendar fields.

I used the (workaround, fix, solution or whatever we call it ? ) in my functions.php.
<<
/**
* Filter event query to show future events
*/
function tssupp_filter_event_query( $view_args, $view_settings, $view_id )...
>>

Result in the test page:
* No results message.

After trying and debugging I almost lost faith in a solution until I tried select all posts to have a some content for the view.
I selected >> Posttypes >> Posts AND (by mistake) left the >> Events also selected.
* Now the page shows the events with dates only in the future!!

So no Filter added.

With the filter "Taxonomyfilter" I was able to show events per event category.

Then I deselected the Posts under Posttypes and the page gave me a
* No results message.

After trying this a couple of time on different views it seems that now you can query events by using the Posttype >> Posts in combination with >> Events to show events in a loop...

Don't know if that was intended to be so, but it never worked like that before...

Hope you can help me with this.

#1122537

Hello,

Please check these:
1) In case it is a compatibility problem, please deactivate other plugins, and switch to wordpress default theme 2017, and test again
2) Since it is a custom codes problem, please provide a test site with the same problem, also point out the problem page URL and view URL, and where I can edit your custom PHP codes, I need a live website to test and debug.

#1127341

I found the plugin that conflicts.

Woocommerce > Cart Reports (Ultimatewoo Version: 1.5.6 with Cart Reports 1.1.20)

After deactivating this plugin I was able to use the query with only setting Posttypes > Events

#1127343

My issue is resolved now. Thank you!