Show actual date of the event in widget and not the current date

Home Forums Calendar Products Events Calendar PRO Show actual date of the event in widget and not the current date

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1003484
    explorer
    Participant

    Hi,

    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

    #1003756
    Geoff
    Member

    Hey @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

     

    #1003802
    explorer
    Participant

    This reply is private.

    #1003936
    Geoff
    Member

    My 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!
    Geoff

    #1004155
    explorer
    Participant

    This reply is private.

    #1004258
    Geoff
    Member

    Hmm, 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!
    Geoff

    #1004346
    explorer
    Participant

    This reply is private.

    #1004893
    Geoff
    Member

    Thanks for the code!

    Here’s the template I’m working with. Does it work for you like it is for me?

    Thanks!
    Geoff

    #1004902
    explorer
    Participant

    This reply is private.

    #1005073
    Geoff
    Member

    That 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!
    Geoff

    #1006269
    explorer
    Participant

    Hi 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
    Felix

    #1006313
    Geoff
    Member

    Oh 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,
    Geoff

    #1010899
    Support Droid
    Keymaster

    This 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.

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Show actual date of the event in widget and not the current date’ is closed to new replies.