Forum Replies Created
-
AuthorPosts
-
June 15, 2018 at 1:14 am in reply to: Trouble understanding start_date in tribe_get_events() #1554070
Christophe Rocour
ParticipantThis reply is private.
June 15, 2018 at 1:12 am in reply to: Trouble understanding start_date in tribe_get_events() #1554069Christophe Rocour
ParticipantTHANK YOU Cliff, this works like a charm! Now I get the results I expect!
I will explain my license issue in a private reply hereafter.
June 14, 2018 at 2:00 pm in reply to: Trouble understanding start_date in tribe_get_events() #1553833Christophe Rocour
ParticipantI’m so sorry that my English is too bad to explain clearly what my question is. I will try one final time.
Our website is http://foto-agenda.nl . It’s a website where photo exhibitions are listed. These exhibitions are the events. They start on a different date than they end. Start time and end time are not relevant and not in use.
On my testpage I’m trying to show a list of all events that will have their start date set to today or in the future. So NOT events that started on month ago and are still going on because they end in the future, only the events that have their first date (what I call their start date) today or later.
I am using a slightly altered version of this example I found in your knowledge base:// Retrieve the next 5 upcoming events $events = tribe_get_events( array( 'posts_per_page' => 5, 'start_date' => date( 'Y-m-d H:i:s' ) ) );My version:
// Retrieve all events that have set their start date today or later $now_amsterdam = new DateTime( 'now', new DateTimeZone( 'Europe/Amsterdam' ) ); $aEvents = tribe_get_events( array( 'start_date' => $now_amsterdam, 'posts_per_page' => -1 ) );But as you can see on the testpage there are events listed that have their start date in the past and THAT is what I don’t understand. Why does this query give me events that start in the past while I expect that I only would get events that start today or later?
Could it be that an event that started in the past and has its end date in the future, is considered as having a start date today? Is that the logic behind the (for me) unexpected results? And if so, how do I filter out events that have their first start date set in the past?
I hope I explained it more clearly now, thank you for your patience!
June 13, 2018 at 2:38 am in reply to: Trouble understanding start_date in tribe_get_events() #1552123Christophe Rocour
ParticipantI know that I have to figure out my own custom coding but through this post I am trying to understand how the events calendar ‘calculates’ the start date in events that span multiple days (like the events on our site).
I’m using the example found in your knowledge base but I’m also getting events that have already started in the past instead of only the ones that will start today and in the future as I would expect. I don’t understand that (see my initial post). If you could just point to the part of the documentation where the start_date is explained, it would be very helpful and I will work the custom coding out myself.
June 11, 2018 at 3:43 am in reply to: Trouble understanding start_date in tribe_get_events() #1550563Christophe Rocour
ParticipantHi Cliff, this is sabinevi from another account since the license of EC of my own account was not continued by the customer whom I bought it for.
I changed the date to
$now_amsterdam->format( 'Y-m-d H:i:s' )but that didn’t solve it for me. Any other thoughts on this subject?
Christophe Rocour
ParticipantGreat, it works again like it did before.
Thanks for the swift solution! -
AuthorPosts
