Support

Home Forums Event Espresso Premium Display single day on EE4 calendar

Display single day on EE4 calendar

Posted: March 5, 2018 at 2:19 pm

Viewing 16 reply threads


JustWalk

March 5, 2018 at 2:19 pm

Hi

I need to display 3 calendars on a page one for each day of an event with up to 30 events on each day. I dont see how to add the exact date in the shortcode? I see you can add the month ie: month=11 year=2018 this is no use i just want to display the single day?

ie.

Day 1 calendar with 30 events (ONE DAY VIEW)
Day 2 calendar with 30 events (ONE DAY VIEW)
Day 3 calendar with 30 events (ONE DAY VIEW)

I have tried [ESPRESSO_CALENDAR event_venue_id=4615 cal_view=basicDay month=11 year=2018 day=25]

But it defaults to the first day of November? How do i set the EXACT day please?

Thanks in advance.


Josh

  • Support Staff

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.


JustWalk

March 8, 2018 at 7:06 am

Hi Josh

Thanks a lot for that it seems like a great solution! In the meantime i had implemented another one to display the first day of the event in a single basic day view by editing to the espresso_calendar.js and adding these lines…

defaultView: ‘basicDay’,

$(‘#espresso_calendar’).fullCalendar(‘gotoDate’, 2018, 10, 24);

Then by adding this to the page…

<script>
jQuery(document).ready(function($) {
$('.changeDate').click(function() {
$('#espresso_calendar').fullCalendar('gotoDate', 2018, 10, 24);
});
$('.changeDate2').click(function() {
$('#espresso_calendar').fullCalendar('gotoDate', 2018, 10, 25);
});
$('.changeDate3').click(function() {
$('#espresso_calendar').fullCalendar('gotoDate', 2018, 10, 26);
});
});
</script>

<a class="changeDate">24th</a>
<a class="changeDate2">25th</a>
<a class="changeDate3">26th</a>

[ESPRESSO_CALENDAR event_category_id=42]


Josh

  • Support Staff

March 8, 2018 at 7:15 am

The only downside is you’ll lose your changes when you directly edit espresso_calendar.js.

The example I shared with you shows how you can add an inline script to load after espresso_calendar.js with wp_add_inline_script(). This way you’re not hacking core files and will not lose your customizations when the software is updated.


JustWalk

March 8, 2018 at 7:15 am

Again thanks for your help if i can get this working i would be really grateful…..

The main problem now is i have to have the Three Days of the event all display on the calendar at the same time with a custom Three day view with no navigation.

After reading all of the documentation on Full calendar.io i found that this is possible but im having real problems implementing this…

https://fullcalendar.io/docs/custom-view-with-settings

Can you tell me how i can get this working and remove the navigation and day month week views please?


JustWalk

March 8, 2018 at 8:14 am

This is what im trying to do…

<script>
jQuery(document).ready(function($) {
$('#espresso_calendar').fullCalendar({
    header: {
        center: 'agendaThreeDay' // buttons for switching between views
    },
    views: {
        agendaThreeDay: {
            type: 'agenda',
            duration: { days: 3 },
            buttonText: '3 day'
        }
    },
    defaultView:'agendaThreeDay'
});
</script>

[ESPRESSO_CALENDAR event_category_id=42]


Josh

  • Support Staff

March 8, 2018 at 8:39 am

Hi,

I’m afraid the version of fullcalendar that’s included in the Event Espresso 4 calendar does not support custom views like agendaThreeDay.

You can remove the navigation buttons by going to Event Espresso > Calendar > Advanced Settings, then blank out the Right: and Left: fields


JustWalk

March 8, 2018 at 8:57 am

Hi Josh

This is one of the only reasons i went with event espresso for this new site as i thought this functionality was built in to the calendar or would be easier to add. Is there a way to integrate this functionality i would be happy to pay as i need this working very soon?


Josh

  • Support Staff

March 8, 2018 at 9:07 am

You thought custom views like agendaThreeDay were supported by the Event Espresso Calendar add-on? May I ask was there something you read somewhere that led you to believe this?

In order to get something like this developed it’d require starting from scratch with a new calendar add-on because the current version of the calendar add-on doesn’t integrate with the newer versions of FullCalendar.js.


JustWalk

March 8, 2018 at 9:14 am

Hi Josh

I may have got my wires crossed with another plugin I was researching.

As a stopgap is it possible to get the 3 days showing in the middle of the week view please?

Thanks again,
Ben.


Josh

  • Support Staff

March 8, 2018 at 9:42 am

Hi Ben,

You can set the First Day of the Week option in Event Espresso > Calendar and change it to Friday or whichever day will put the 3 days into the middle of the week.

Then you use this shortcode on the page:
[ESPRESSO_CALENDAR cal_view=basicWeek]

Then you add this code to the custom plugin:

function eecal_custom_start_week(){
    wp_add_inline_script( 
        'espresso_calendar',
        'function my_go_to_date() {
            jQuery("#espresso_calendar").fullCalendar( "gotoDate", 2018, 10, 25);
        };
        jQuery( document ).ready(function($) {
            $( document ).ajaxComplete(my_go_to_date);
        });'
    );
}
add_action( 'wp_enqueue_scripts', 'eecal_custom_start_week', 20 );


JustWalk

March 8, 2018 at 10:13 am

Hi Josh

Thanks for the fast reply!

It seems to be defaulting to Nov 11th – 17th 2018 or Nov 18th – 24th 2018 i want it to start the week on Thursday 11th Nov so the Saturday Sunday And Monday are central. I have tried changing the dates here…

jQuery("#espresso_calendar").fullCalendar( "gotoDate", 2018, 10, 25);

But it wont start on the day of the 22nd whatever i do?

Thanks
Ben


Josh

  • Support Staff

March 8, 2018 at 10:20 am

May I ask which day do you have set on the Event Espresso > Calendar settings page for the First Day of the Week option?


JustWalk

March 8, 2018 at 11:24 am

Hi Josh

Excellent thats working now i just need to tweak the CSS and it will do for now.

If i were to hire someone there to integrate the 3 day option how much would it cost and how long would it take? Im happy for you to contact me outside of the forum on if this is sensitive?

Thanks
Ben.


Josh

  • Support Staff

March 8, 2018 at 11:32 am

Hi Ben,

Event Espresso staff doesn’t do custom development to spec, but you can contact the developers listed here to get a quote:

https://eventespresso.com/developers/event-espresso-pros/


JustWalk

March 17, 2018 at 7:03 am

Hi Josh

Thanks for your time on the calendar issue.

I have a new problem i hope you can help with its mentioned in this support post….

https://eventespresso.com/topic/separate-events-one-required-before-others-are-available/

I have added the cart plugin but the event setup is not correct

the flow we require is…

Main event purchase a 1,2 or 3 day ticket then once registered for the main event you can register for various seminars that run over the 3 days.

I have set the seminars up as seperate events and have set them as Force Login for registrations but it seems that you can still add the seminars to your basket without first registering for the main event.

Am i missing somthing? I expected the cart plugin to be conditional so if a user has not purchased the main event ticket they cant add seminars/sub events to their cart?

Any help is much appreciated thanks

(I have a staging site but dont want the url here if it would help i can give you the details)


Tony

  • Support Staff

March 19, 2018 at 4:46 am

Am i missing somthing? I expected the cart plugin to be conditional so if a user has not purchased the main event ticket they cant add seminars/sub events to their cart?

May I ask what lead you to believe that? If there is something inn our documentation that makes it appear to work that way I’d like to get that updated.

Currently Event Espresso does not allow you to setup events as a condition to allow registrations on another event. With the thread you liked to what Josh did was use the capability requirement added by the WP User Intergration add-on:

https://eventespresso.com/wiki/wp-user-integration/#ee4usage

So that the ‘additional’ event(s) have a capability set on the tickets, then use some code to add that capability to the users account if they register onto the ‘main’ events.

Will that work for you?

Viewing 16 reply threads

The support post ‘Display single day on EE4 calendar’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso