Home › Forums › Calendar Products › Events Calendar PRO › Start date of events updated to current day
- This topic has 4 replies, 3 voices, and was last updated 10 years ago by
Support Droid.
-
AuthorPosts
-
April 7, 2016 at 2:26 am #1099423
Sofia
ParticipantHi, I searched in forums but could no find an answer to my problem. I want the start day to be updated to the current day. Ex. I have an event from 5 – 10 April, I want if today we are on the 7th of April the start date be updated to 7 – 10 April. I wonder if there’s an easy way of doing this. Thanks.
April 7, 2016 at 5:20 am #1099477Brook
ParticipantHowdy Sofia,
That’s an interesting idea, never seen this thought of before. It’s definitely possible for a programmer to accomplish this using our API, might take 1-2 hours of time for an experienced dev to build and test.
If you have such a dev here’s what to do:
- Checkout the function tribe_events_event_schedule_details(). This outputs the date range in most places on the calendar.
- You could override its output using the filter ‘tribe_events_event_schedule_details_inner’ I would copy/paste the logic from that function and just override this filter with a rennamed version of the same function.
- Now just check if tribe_get_start_date() < now but tribe tribe_get_end_date() > now, if so override it the start date with the current one.
- Finally you might wish to override the data in more place on the calendar. You probably don’t want to override the date in the backend, but perhaps you would want to override the single event details area. You could do this by following our Themer’s Guide. You might prefer to not even override the date in this the full details area, but instead add some kind of note about the event continuing today. This is totally up to you.
Does that all make sense? Will that work for you? Please let me know.
Cheers!
– Brook
April 7, 2016 at 11:07 am #1099718Sofia
ParticipantHi Brooks,
I asked this because it makes a calendar way more “readable” with multiple days event. It can get very confusing to interpret with the start dates.
Thanks for the answer, I am a just a beginner in PHP but I do understand the logic of what you said. Probably I will hire a developer to do this. Many thanks for pointing the direction.
April 7, 2016 at 6:41 pm #1099904Brook
ParticipantYou’re welcome Sofia. Please let us know if we can be of further help.
I should clarify one thing, your website appears to only use List View which makes this a lot easier to do. If you wanted to do something similar for Month or Week view it would a bit more complicated to pull off. In that case I would recommend a different strategy involving using WP Cron to actually change the event date. Let me know if this is your goal and I can dive into detail here.
Cheers!
– Brook
April 22, 2016 at 9:35 am #1105987Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Start date of events updated to current day’ is closed to new replies.
