Support

Home Forums Events Calendar Add-on EE3 – Calendar doesn't show events

EE3 – Calendar doesn't show events

Posted: September 29, 2014 at 10:12 am


Pauline

September 29, 2014 at 10:12 am

Hello,
WordPress version : WordPress 4.0
Event Espresso : 3.1.36.6.P
installed add-ons : Event Espresso – Calendar Version 2.2.4.p

I can not view the event in the calendar: http://www.lakzaevents.com/calendrier/
The theme used is twenty twelve and I disabled every plugin except Event Espresso and Espresso Event – Calendar
Thank you in advance


Tony

  • Support Staff

September 29, 2014 at 11:40 am

Hi Pom,

Can you edit one of the events and tell me the Event and Registration Start/End dates please?

Also what do you currently have set for the ‘Date format’ within Dashboard -> Settings -> General?


Pauline

September 29, 2014 at 12:06 pm

Thank you for your reply.
Mon event http://www.lakzaevents.com/evenements/?ee=6 :
Event Start Date 2014-10-03
Event End Date 2014-10-04
Date format : 29 septembre 2014

I try to change the date format but it doesn’t change anything ?


Lorenzo Orlando Caum

  • Support Staff

September 29, 2014 at 12:21 pm

Hi,

Is there any maintenance on the server? I tried to complete a test registration for the event that you shared and it isn’t getting past the single event registration page.

Was Event Espresso 3 installed through WordPress plugins or manually via SFTP or FTP?


Lorenzo


Tony

  • Support Staff

September 29, 2014 at 12:33 pm

What is set for the Registration start/end date?


Pauline

September 29, 2014 at 12:40 pm

I’m not sure I understand. There is no maintenance procedure on the server (It should be, because the website is not finish, but I reactivated it in order to let you help me 🙂
I can see you completed the form in the backoffice, but the paiement settings are not completely ok for the moment.
Is it possible that the problem is there?
From memory, I installed plugins via wordpress tool but I’m not sure

Registration start/end date :
2014-09-01
2014-10-02


Tony

  • Support Staff

September 29, 2014 at 1:14 pm

Hi Pom,

After discussing this with @sidney I think we’ve found the problem.

Can you open up espresso-calendar/espresso-calendar.php, go to lines 583-586:

$events[ $cntr ]['start'] = date("c", strtotime($event->start_date . ' ' . event_date_display($event->start_time, get_option('time_format'))));
			$events[ $cntr ]['end'] = date("c", strtotime($event->end_date . ' ' . event_date_display($event->end_time, get_option('time_format'))));
			$events[ $cntr ]['reg_start'] = date("c", strtotime($event->registration_start . ' ' . event_date_display($event->registration_startT, get_option('time_format'))));
			$events[ $cntr ]['reg_end'] = date("c", strtotime($event->registration_end . ' ' . event_date_display($event->registration_endT, get_option('time_format'))));

Change those to:

$events[ $cntr ]['start'] = date("c", strtotime($event->start_date . ' ' . event_date_display($event->start_time, 'H:i')));
			$events[ $cntr ]['end'] = date("c", strtotime($event->end_date . ' ' . event_date_display($event->end_time, 'H:i')));
			$events[ $cntr ]['reg_start'] = date("c", strtotime($event->registration_start . ' ' . event_date_display($event->registration_startT, 'H:i')));
			$events[ $cntr ]['reg_end'] = date("c", strtotime($event->registration_end . ' ' . event_date_display($event->registration_endT, 'H:i')));

Refresh the calendar page and see if the events are displayed correctly.


Pauline

September 30, 2014 at 2:33 am

Thank you, it works fine now!
Can you explain me what the problem was with the original code?


Tony

  • Support Staff

September 30, 2014 at 2:48 am

It’s the date format your site is using, from this:

Date format : 29 septembre 2014

I’m guessing your date format is ‘j F Y’ – http://take.ms/51ZFr

strtotime() fails when using this format. So this line:

$events[ $cntr ]['start'] = date("c", strtotime($event->start_date . ' ' . event_date_display($event->start_time, get_option('time_format'))));

On your site is actually

$events[ $cntr ]['start'] = date("c", strtotime($event->start_date . ' ' . event_date_display($event->start_time, 'j F Y')));

Which causes strtotime() to return either nothing or an invalid value, which then confuses the calendar. So the modified code above forces your calendar to use a sepcific format, rather than the one your site uses.

The support post ‘EE3 – Calendar doesn't show events’ 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