Upcoming Events Widget — Events in Same Month but Different Year Display Day

Home Forums Calendar Products Events Calendar PRO Upcoming Events Widget — Events in Same Month but Different Year Display Day

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1617561
    sixpastures
    Participant

    I am using Events Calendar Pro, and have the Upcoming Events widget on this page:

    Six Pastures

    I understand that the default behavior of this plugin is to display the name of the day instead of month in the “month/day” box if the event is in the same month when viewed. However, you can see that the event that is set for Sept 2019 is also showing the name of the day “Sat” instead of the month “Sep”. How can I get events in Sept 2019 to display month name instead of day name?

    #1618401
    Jeremy
    Keymaster

    Hi,

    Thanks for reaching out to us! I’d be happy to help you 🙂

    Well, in order to display the month instead of the day in your Upcoming Events widget, you would have to customize our templates files. Before doing anything, I would recommend you to read carefully our Themer’s Guide.

    Once you’re ready, you can copy the file located at wp-plugins/events-calendar-pro/src/views/pro/widgets/modules/single-events.php

    Then, you can override this template in your own theme by creating a file at [your-theme]/tribe-events/pro/widgets/modules/single-event.php

    You will have to remove the following condition:

    <?php
    if (
    isset( $instance['tribe_is_list_widget'] )
    && date( 'm', $post_date ) != date( 'm', current_time( 'timestamp' ) )
    ) :
    ?>
    <span class="list-dayname">
    <?php
    echo apply_filters(
    'tribe-mini_helper_tribe_events_ajax_list_dayname',
    date_i18n( 'M', $post_date ),
    $post_date,
    $mini_cal_event_atts['class']
    );
    ?>
    </span>
    <?php else: ?>
    <span class="list-dayname">
    <?php
    echo apply_filters(
    'tribe-mini_helper_tribe_events_ajax_list_dayname',
    date_i18n( 'D', $post_date ),
    $post_date,
    $mini_cal_event_atts['class']
    );
    ?>
    </span>
    <?php endif; ?>

    You will just need to display the following span:

    <span class="list-dayname">
    <?php
    echo apply_filters(
    'tribe-mini_helper_tribe_events_ajax_list_dayname',
    date_i18n( 'M', $post_date ),
    $post_date,
    $mini_cal_event_atts['class']
    );
    ?>
    </span>

    I hope this helps.

    Cheers,
    Jeremy

    #1618471
    sixpastures
    Participant

    So, just so I understand, you’re saying that the expected behavior is for events in September 2019 to display day name instead of month name in the Upcoming Events widget? I understand that is the expected behavior for events in September 2018 (at the time of this post that is the current month) but it seems like a bug to me that it would also cause that behavior in September of the following year as well…

    If I make the code changes outlined above, will it stop the day name from showing in both September 2018 and 2019 events, or just 2019? I don’t want to stop the intended behavior for the current month, just the somewhat confusing change happening to Sept 2019 events.

    #1619268
    Jeremy
    Keymaster

    Hi,

    You are absolutely right, this is a bug. I have just attached your ticket to the bug report and I will set this thread as “Pending fix”, so that we could warn you as soon as the problem is resolved 🙂

    Meanwhile, you may use the following snippet to override the template until this is fixed in the plugin:

    Copy the file from:
    https://gist.github.com/skyshab/9771462a81705b515527e75ce3953add

    into [your-theme]/tribe-events/pro/widgets/modules/single-event.php

    I hope this helps! Please let me know if you have any other questions in the meantime.

    Thank you for your patience and understanding.

    Cheers,
    Jeremy

    #1882818
    Jennifer
    Keymaster

    Hello,

    Just wanted to let you know that a new maintenance release is out, including a permanent fix for this issue with the list widget.

    Find out more about this release → https://theeventscalendar.com/announcing-the-events-calendar-4-9-9-and-events-calendar-pro-4-7-8/

    Please try updating and let us know if you are experiencing any further issues. As always, we recommend running updates on your staging site before doing so on your live site, just to be on the safe side.

    Thanks again for your patience while we worked on getting this fixed!

    Jennifer

    #1896301
    Support Droid
    Keymaster

    Hey 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

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Upcoming Events Widget — Events in Same Month but Different Year Display Day’ is closed to new replies.