Home › Forums › Calendar Products › Events Calendar PRO › Show actual date of the event in widget and not the current date
- This topic has 12 replies, 3 voices, and was last updated 10 years, 7 months ago by
Support Droid.
-
AuthorPosts
-
September 9, 2015 at 1:55 pm #1003484
explorer
ParticipantHi,
Apparently it is by design that the calendar widget shows the current date in the icon if an event already started. How can I chance the the calendar listing to show only the actual start date of the event.
Thanks for your help
September 10, 2015 at 9:04 am #1003756Geoff
MemberHey @explorer–nice to see you again and hope all is well. 🙂
Yes, it should be possible to show the start date of the event rather than the current date for ongoing events that are currently taking place.
There is this code in the pro/widgets/modules/single-event.php file:
<div class="list-date"> <span class="list-dayname"><?php echo apply_filters( 'tribe-mini_helper_tribe_events_ajax_list_dayname', date_i18n( 'D', $postDate ), $postDate, $mini_cal_event_atts['class'] ); ?></span> <span class="list-daynumber"><?php echo apply_filters( 'tribe-mini_helper_tribe_events_ajax_list_daynumber', date_i18n( 'd', $postDate ), $postDate, $mini_cal_event_atts['class'] ); ?></span> </div>You override that template (more on that in our Themer’s Guide) and change the $postDate variables to $start_date and that should give you the date you’re looking for.
Let me know if that helps do the trick!
Geoff
September 10, 2015 at 10:51 am #1003802explorer
ParticipantThis reply is private.
September 10, 2015 at 2:32 pm #1003936Geoff
MemberMy apologies there! This should work instead:
<div class="list-date"> <span class="list-dayname"><?php echo apply_filters( 'tribe-mini_helper_tribe_events_ajax_list_dayname', tribe_get_start_date( $id, false, 'D', false ), $mini_cal_event_atts['class'] ); ?></span> <span class="list-daynumber"><?php echo apply_filters( 'tribe-mini_helper_tribe_events_ajax_list_daynumber', tribe_get_start_date( $id, false, 'd', false ), $mini_cal_event_atts['class'] ); ?></span> </div>Sorry for the confusion! I just used this on my own test site and got the correct start date for current events that start on an earlier date. 🙂
Cheers!
GeoffSeptember 11, 2015 at 5:27 am #1004155explorer
ParticipantThis reply is private.
September 11, 2015 at 8:12 am #1004258Geoff
MemberHmm, shoot. I thought that would do the trick. In fact, it still continues to work on my test site (screenshot).
Can you perhaps share the code for your pro/widgets/modules/single-event.php template override so I can see if there are any differences between what we have in there? You can share that in a Gist and I can compare it from there.
Thanks!
GeoffSeptember 11, 2015 at 10:04 am #1004346explorer
ParticipantThis reply is private.
September 14, 2015 at 8:57 am #1004893Geoff
MemberThanks for the code!
Here’s the template I’m working with. Does it work for you like it is for me?
Thanks!
GeoffSeptember 14, 2015 at 9:04 am #1004902explorer
ParticipantThis reply is private.
September 14, 2015 at 4:59 pm #1005073Geoff
MemberThat is very strange!
Quick question: does the same thing happen if you switch to a default WordPress theme and make the template override there?
Just want to see if there’s a difference in the themes we’re using.
Thanks!
GeoffSeptember 17, 2015 at 4:27 pm #1006269explorer
ParticipantHi Geoff,
If I switch to the default theme, the dates are correct. So it seems something of the code is not working together nicely with our theme.
Best
FelixSeptember 17, 2015 at 8:15 pm #1006313Geoff
MemberOh shoot, sorry about that! It’s pretty tough for me to pinpoint what could be throwing it off on the theme-level, but I’d be happy to answer any questions as best I can!
Cheers,
GeoffOctober 2, 2015 at 7:05 am #1010899Support 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 ‘Show actual date of the event in widget and not the current date’ is closed to new replies.
