Home › Forums › Calendar Products › Events Calendar PRO › Make a week span 8 days in this week – widget?
- This topic has 7 replies, 2 voices, and was last updated 6 years, 9 months ago by Anders.
-
AuthorPosts
-
June 26, 2017 at 7:43 am #1306310AndersParticipant
Hi There,
is there a way to make the week span 8 days in the “This Week” widget?
I need to include both Sundays around any given week.Or – if there is a way to set the start day for the This Week widget only, to start on Mondays, that might be an acceptable work around. I can’t change the global settings though, since that would also change the monthly view in the main calendar.
/anders
June 28, 2017 at 7:51 am #1310151BarryMemberHi Anders,
If you have an event spanning a long period of time – suppose it started 4 weeks ago and ends 4 weeks from now – it should indeed appear in the This Week widget’s output.
Are you finding that isn’t the case, or is there something about the way this works you want to tweak further? I’m not completely clear as to the end goal here – so any extra info you can provide would be appreciated!
Thanks 🙂
June 28, 2017 at 8:00 am #1310153AndersParticipantNo – I’m not talking about events that span multiple weeks.
is there a way to make the week span 8 days in the “This Week” widget?
I need to include both Sundays around any given week.The end goal would be to have a list where both Sundays around a given week is included. Like this:
Sunday - Events here - Monday - Events here - etc.. Saturday - Events here - Sunday - Events here -
The use case is when working with churches who have a lot of things going on on Sundays, the current setup limits the upcoming events week view to either display Sundays first and then the rest of the week (but not next Sunday.). That is less then ideal.
Or you would have to set the global settings in WP to have the week begin on a Monday (and have Sundays listed at the bottom of the Weekly Events widget.) This is also less then ideal, since it would mean all other views (like the monthly calendar etc) would be effected by this setting.So – is there a way to override the 7 day setting in the weekly view widget and have it include 8 days, starting and ending with Sundays?
/anders
June 28, 2017 at 8:17 am #1310160BarryMemberThanks for clarifying, Anders – I see what you mean now.
As a piece of customization work you can certainly tweak the arguments used to build the query using the following hook:
tribe_events_pro_this_week_widget_query_args
Modifying either the start_date or end_date field (or both) could work for you here. Here’s an example, assuming that in practice all you really need to do is push out the end date by one day:
add_filter( 'tribe_events_pro_this_week_widget_query_args', function( array $args ) { $end_date = strtotime( $args['end_date'] ) + DAY_IN_SECONDS; $args['end_date'] = date( 'Y-m-d', $end_date ); return $args; } );
You could of course pull the start date back a day using a similar approach (and this code could be placed inside a custom plugin).
Does that work for you, at least as a starting point you can build on?
June 28, 2017 at 8:19 am #1310162AndersParticipantGreat. That’s the starting point I was looking for. I’ll look into this next week, but for now we’re all good!
June 28, 2017 at 8:25 am #1310166BarryMemberFantastic 🙂
July 20, 2017 at 9:35 am #1323900Support 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 ‘Make a week span 8 days in this week – widget?’ is closed to new replies.