Home › Forums › Calendar Products › Events Calendar PRO › _EventDuration multi day event
- This topic has 12 replies, 2 voices, and was last updated 6 years, 9 months ago by Susan.
-
AuthorPosts
-
May 24, 2017 at 2:54 pm #1288640SusanParticipant
I have several event feeds on our web site generated by using the Custom Content plugin and the Tribe Events custom post types and meta fields. To differentiate between multi day and single day events I have been using ‘if field=_EventDuration compare=more value=86399’ (86399 is the seconds in 24 hours minus 1), and it’s been working. I just entered three new multi-day events today and they are not being recognized as multi-day by the Custom Content loops. Multi-day events that were entered several months ago are still being recognized properly, and both new and previously entered events are still being recognized as multi-day by the Events Calendar templates.
I tried switching the duration value to ‘1439’ (minutes instead of seconds), the newly entered events still weren’t recognized as multi-day, although all events entered a while back with a duration over 1439 seconds now were displayed as multiday events.
I don’t know exactly where the crossover happened because we don’t have that many. Maybe the way duration is stored/calculated changed when the date/time interface changed? How do I specify the duration now for multi-day?
You can see it on this page: http://www.sierranevada.edu/resources/current-undergraduate-students/. In the 5 items under ‘Event Calendar’, ‘New Student Orientation’ (added today) runs August 14 – August 16. ‘Travel Course – South Africa Service Learning’ and ‘MiddCORE 2017’, which are displaying correctly, were entered several months ago.
May 25, 2017 at 10:27 am #1289004SusanParticipantI did some more experimenting and found that the _EventDuration field listed on the WordPress post meta page is not being propagated on the newly added events.
May 26, 2017 at 7:58 pm #1289679VictorKeymasterHi Susan!
Thanks for reaching out to us! Let me help you with that issue.
When you say:
the _EventDuration field listed on the WordPress post meta page is not being propagated on the newly added events.
Do you mean the _EventDuration field is not being saved in the database for the newly added events? If not, where are you seing this info missing? Let us know about it.
Thanks,
VictorMay 30, 2017 at 9:47 am #1290893SusanParticipantTo explore what’s going on, I added code on a test page which writes the content of _EventDuration to the page. Events which were added in the past display the duration correctly, in seconds, for short, all day, and multi-day all day events. The recently added events referenced above display nothing for duration. The start and end timestamps are correct for all events.
May 31, 2017 at 6:23 am #1291235VictorKeymasterHi Susan!
Thank for coming back explaining what you’ve found so far.
I made a couple of tests and the event duration is saving correctly for single and multi day events.
I’m not very familiar with the Custom Content plugin, so I’m not really sure how it works. But, to make sure the _EventDuration postmeta is saving, you should look that up in the database. For example, you could search the post_id (of the event you are having trouble with) in the wp_postmeta table and see if there is a _EventDuration meta_key saved for that venue.
If there is, then the issue could be related to the Custom Content plugin. If not, then there could be a theme or plugin conflict, so you should go through the testing for conflicts guide here > https://theeventscalendar.com/knowledgebase/testing-for-conflicts/ and see what you find in the process.
Let me know how that goes and if you have any questions.
Best,
VictorMay 31, 2017 at 9:57 am #1291376SusanParticipantThis reply is private.
June 1, 2017 at 4:27 pm #1292122VictorKeymasterThis reply is private.
June 2, 2017 at 10:39 am #1292524SusanParticipantThis reply is private.
June 2, 2017 at 5:51 pm #1292676VictorKeymasterThis reply is private.
June 6, 2017 at 10:11 am #1293885SusanParticipantI need to be able to distinguish between one day and multi day all day events. One day only the start date displays, multi day both start and end dates display. Checking for start date not equal to end date doesn’t work because the dates are saved as timestamps, and for all day events start TIME is 00:00:00 and end time is 23:59:59. Is there a snippet I could add to our functions.php file that would save the _EventDuration metadata for all events? Thx, Susan
June 6, 2017 at 7:30 pm #1294156VictorKeymasterHi Susan!
I’d be happy to help you with this.
First off, I do want to note that we are fairly limited in how much we can support custom development questions like this.
That said, I’d be happy to at least point you in the right direction as best I can.
We have a couple of helper functions that will allow you to check if an event is a multi day event or if it’s an all day event. One is tribe_event_is_multiday() and the other one is tribe_event_is_all_day()
I know you are using the Custom Content plugin, which I’m not very familiar with, but perhaps you can make use of these functions with it.
We also have a great article that will get you started on customizing our templates here > https://theeventscalendar.com/knowledgebase/themers-guide/
I hope that helps and let me know if you have other questions.
Best,
VictorJune 28, 2017 at 9:35 am #1310229Support DroidKeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘_EventDuration multi day event’ is closed to new replies.