Support

Home Forums Event Espresso Premium Display single day on EE4 calendar Reply To: Display single day on EE4 calendar

Reply To: Display single day on EE4 calendar

Author Replies
Josh # Posted on March 6, 2018 at 10:38 am

Hi JustWalk,

While the shortcode doesn’t accept additional “exact day” parameters, you can use a bit of custom jQuery code to make each calendar go directly to a specified date.

So for example you can wrap the calendar shortcode with a division like so:

<div id="day-one">
[ESPRESSO_CALENDAR cal_view=basicDay]
</div>

then on your other calendar page:

<div id="day-two">
[ESPRESSO_CALENDAR cal_view=basicDay]
</div>

and so on, then add this code to a site specific plugin:

function eecal_custom_start_month(){
    wp_add_inline_script( 
        'espresso_calendar',
        'function my_go_to_date() {
            jQuery("#day-one #espresso_calendar").fullCalendar( "gotoDate", 2018, 10, 25);
            jQuery("#day-two #espresso_calendar").fullCalendar( "gotoDate", 2018, 10, 26);
            jQuery("#day-three #espresso_calendar").fullCalendar( "gotoDate", 2018, 10, 27);
        };
        jQuery( document ).ready(function($) {
            $( document ).ajaxComplete(my_go_to_date);
        });'
    );
}
add_action( 'wp_enqueue_scripts', 'eecal_custom_start_month', 20 );

Please note that the FullCalendar jQuery plugin actually starts counting months at 0 = January, so November is actually counted as 10 in the code.

You can add the above to a functions plugin.

Do NOT follow this link or you will be banned from the site!