Support » Plugin: The Events Calendar » Style days outside selected month

  • Resolved hristkop

    (@hristkop)


    Hello,

    I can’t find a solution to this simple problem, on my calendar in month view, the days that belong to that month are with same color with the days from the previous or next month. This is confusing and I want to change the colors, so that the last days of previous month (or the first days of the next month) that are shown to be a little faded, and only the days of the current selected month to be highlighted or bold. How can i achieve this, since all the days have same class?

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor GeoffBel

    (@geoffbel)

    Hey @hristkop

    Thank you for reaching out.
    There are a couple of things you can do:

    1. Use a template override to add the classes of your choosing to any view or widget
    2. Consider voting for that feature here https://app.loopedin.io/the-events-calendar-suite-roadmap?idea=60e7b3b35c63cc002fe9cc2b

    Best regards,
    Geoff

    Thread Starter hristkop

    (@hristkop)

    Hello, thanks for the quick answer. I’ve tried to override the template :
    /wp-content/plugins/the-events-calendar/src/views/v2/month/calendar-body/day.php
    but nothing changes on the month view, the classes stay the same.

    Am I using the wrong file or what could be the mistake?

    Thanks!

    Thread Starter hristkop

    (@hristkop)

    I managed to solve this, the problem was that Enable the Month View Cache was selected. Unchecking the Events – Settings – Display – Enable the Month View Cache solved my problem.

    Now, for the current month the days are fine, but if I select calendar for the next months, this isn’t working because I’m comparing :
    $day[‘month_number’]=== $today_date

    Is there a way to take the month that is selected(not the month of $today_date) so I could compare it with the $day[‘month_number’], in order this to work for all months and not only for the current?
    Thanks.

    • This reply was modified 1 month, 3 weeks ago by hristkop.
    Thread Starter hristkop

    (@hristkop)

    Does anyone have any idea how to solve this issue? How to compare $day[‘month_number’] with the selected month, not current month only ?
    Thanks.

    Thread Starter hristkop

    (@hristkop)

    Ok I’ve managed to solve this issue, so I’m marking it as resolved.
    For anyone having a same issue, comparing $day[‘month_number’] with $grid_date solved my problem.
    In /wp-content/plugins/the-events-calendar/src/views/v2/month/calendar-body/day.php :

    $month_compare = explode("-", $grid_date); //devide the string 
    
    if ( $day['month_number']=== $month_compare[1]  ) {
    	$day_classes[] = 'tribe-events-calendar-month__day--current';
    }else{
    	$day_classes[] = 'tribe-events-calendar-month__day--past';
    }
Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.