Limit classic calendar view to specific number of events per day, add a +more link

If your site has lots of events per day, this snippet will allow you to do the following:

  • Limit the number of events per day in the classic calendar view, and
  • Show a +more link that leads to the Day - List view for that date when clicked.
add_filter( 'piecal_calendar_object_properties', function( $properties ) {
    $properties[] = <<<'JS'
        dayMaxEvents: 2,
        moreLinkClick: ( info ) => {
            window.calendar.gotoDate( info.date );
            piecalChangeView( 'listDay' );
        },
JS;

    return $properties;
} );
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.