Hide Previous and Next months events on mini calendar

Home Forums Calendar Products Events Calendar PRO Hide Previous and Next months events on mini calendar

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #932296
    Jon Nixon
    Participant

    Hi All,

    I have several mini-calendars rendering on my page via:

    $showMonths = 24;
     
    for ($i = 0; $i <= $showMonths; $i++) {
     	
     	$instance = array(
     		'title' => '',
     		'count' => 0,
    		'eventDate' => date("Y-m-d", strtotime("+$i months", mktime(12, 12, 12, date ("n"), 1)))
    		
     	);
    	
    	
     	the_widget( 'TribeEventsMiniCalendarWidget', $instance);
    }

    However, I cannot find a way to hide the previous and next months’ days in the current month. Is there a way around this? It’s driving my client nuts.

    http://thebookinghousemanheim.com/calendar

    #932808
    Barry
    Member

    Hi nixonmedia,

    It’s possible to customize almost all of our templates using the template override process, documented in our Themer’s Guide 🙂

    In this case you could perhaps override and customize the pro/widgets/mini-calendar/grid.php template and – in your custom version – conditionally remove the links generated by the tribe_events_the_mini_calendar_prev_link() and tribe_events_the_mini_calendar_next_link() template tags.

    You could leverage the tribe_events_get_mini_calendar_args() function – which returns an array including eventDate – as part of that conditional statement (ie, to check which month has been requested).

    Does that help?

     

    #932830
    Jon Nixon
    Participant

    I don’t think you’re following. I’m trying to remove the days of the month like so:

    https://www.dropbox.com/s/fl95dqm1btfnno9/calendar.png?dl=0

    #932846
    Barry
    Member

    Ah, I see. I definitely did misunderstand – apologies on that count 🙂

    Each of those day cells (that do not belong to the current month) have a CSS class of tribe-events-othermonth applied to them. With that in mind, would it work for you to add a CSS rule that hides them on that basis, ie:

    .tribe-mini-calendar td.tribe-events-othermonth div { display: none }

    You can add custom rules like this per the instructions found here.

    Does that help?

    #938785
    Barry
    Member

    Hi! It’s been a while so I’m going to go ahead and close this thread. If we can help with anything else, though, please don’t hesitate to create new threads as needed. Thanks!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Hide Previous and Next months events on mini calendar’ is closed to new replies.