• Resolved pablopaul

    (@pablopaul)


    When I select “Day” in the calendar views dropdown, if there are no events and I click on the “next upcoming events” link that is provided, it takes me to the next upcoming event. But, when I go to the Month view after that, today’s date is changed to the 1st of the month.

    Are you aware of this issue? I didn’t see it in your list posted on the Events Calendar website. Would really like to see this fixed, as it could be confusing for visitors to our website, especially when the date is near the 1st of the month.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Darian

    (@d0153)

    Hi @pablopaul

    Sorry to hear about this.

    As it turns out, this issue has already been reported to our development team. I have added your case to our internal ticket [TEC-4686]. While we don’t have an ETA, you’ll get notified once there is an update and fix.

    In the meantime, you could add the snippet code below as a temporary workaround.

    add_filter(
        'tec_events_month_day_classes',
        function( $day_classes, $comparison_date, $day ) {
            $today = \Tribe__Date_Utils::build_date_object();
    
            if ( $day['date'] === $today->format( 'Y-m-d' ) ) {
                $day_classes['tribe-events-calendar-month__day--current'] = true;
            } else {
                $day_classes['tribe-events-calendar-month__day--current'] = false;
            }
    
            return $day_classes;
        },
        100,
        3
    );

    If you’re not familiar with coding, you can use the Code Snippets plugin, which removes the need to add custom snippets to your theme’s functions.php file.

    I hope that helps, and let me know if you have further concerns.

    Best,
    Darian
    —–
    Internal Bug Ticket Reference: TEC-4686

    Plugin Support Darian

    (@d0153)

    Hi @pablopaul

    Please test the snippet code on a Staging Server before doing it on your live site.

    Thread Starter pablopaul

    (@pablopaul)

    I just tested the code snippet you provided on our staging server, and it didn’t work; the date is still reverting to the 1st of the month. I also purged all caches after adding the code to be sure that wasn’t the issue. Since the snippet isn’t causing any errors, I have also added it to our live website so you can see that it is not working. I also purged all the caches there and hard refreshed the browser.

    Thread Starter pablopaul

    (@pablopaul)

    The snippet actually did work! After clearing the caches and hard refreshing the browser, the snippet didn’t start working for some reason until I restarted my browser. Thank you!

    • This reply was modified 1 year, 8 months ago by pablopaul.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Current day in calendar view changes to the 1st of the month’ is closed to new replies.