Skip Navigation

[Resolved] Upcoming Events Calendar events view: need working content selection filter

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/Karachi (GMT+05:00)

This topic contains 4 replies, has 2 voices.

Last updated by chrisL-13 1 year, 4 months ago.

Assisted by: Waqar.

Author
Posts
#2618067
Screen Shot 2023-06-22 at 3.33.35 PM.png
Screen Shot 2023-06-22 at 3.33.42 PM.png

Tell us what you are trying to do?
I am trying to use a view to create an upcoming events listing of The Events Calendar events so that I can get more control over the appearance and output of the events.

Is there any documentation that you are following?
https://toolset.com/forums/topic/format-the-event-calendar-date-outputted-by-views/

Is there a similar example that we can see?

What is the link to your site?
hidden link

The view seems to be ignoring my filter. It doesn't register that it exists. I have to add another filter in order to see it in the view block editor.

#2618301

Hi,

Thank you for contacting us and I'd be happy to assist.

The Toolset's date/time filters are designed to work with the values in UNIX timestamp format. That is the same format in which Toolset's own date-type field stores the values.
( ref: https://toolset.com/course-lesson/filtering-toolset-views-by-dates/ )

The Events Calendar plugin on the other hand stores the event date/time values in human-readable formats.
( as defined in the plugin's settings )

To overcome this difference, you can add a new 'Event Start Date' date type field through the Toolset Types plugin with the events post type.

When adding or editing each event, you'll just need to make sure that you're storing the start date in this Toolset field too. This field will help you in applying Toolset's own date/time filters in the views.

I hope this helps and please let me know if you need further assistance.

regards,
Waqar

#2618323

Have you got a code snippet that helps me copy the data from the built-in start date field to the Toolset start date field?

#2619093

Thanks for writing back.

I'm afraid, I don't have a copy/paste code snippet available for this, but you can use the 'save_post' hook to fire a custom function, that is executed each time an event post is created or updated:
https://developer.wordpress.org/reference/hooks/save_post/

That function will need to get the start date value from the Events Calendar's custom field, convert it to the UNIX timestamp format and then save it in the Toolset's date type field.

For more personalized assistance around custom code, you can also consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/

#2619101

My issue is resolved now. Thank you!