Cannot set property ‘date’ of undefined (Mini calendar on Month view)

Home Forums Calendar Products Events Calendar PRO Cannot set property ‘date’ of undefined (Mini calendar on Month view)

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1287673
    Thomas
    Participant

    Hi,

    I’m having a little problem on a website I’m currently working on.
    I’m using the Mini Calendar in a sidebar and it works perfectly well except in the Month View page of The Events Calendar on mobile.

    As soon as I go under 768px, a javascript error “Cannot set property ‘date’ of undefined” is displayed (You can see the image I’m sending you) and I cannot longer use the arrows to change month in the Mini Calendar (it repeats the same error in the console).

    So basically it works on desktop but not on mobile.

    Is it a known error ? Can you help me resolve it please ?

    Cheers.

    #1288104
    Cliff
    Member

    Hi, Thomas. Sorry you’re experiencing this.

    This isn’t currently a known issue so I’d suggest following these recommended troubleshooting steps for your own site:

    There might be some new updates available. Could you please make sure all your Modern Tribe plugins (and WordPress core) are at their latest versions?

    Once you verify you’re on the latest versions, please test to see if the issue is still happening for you.

    If it is, please follow our Testing for Conflicts Guide (basically switch to Twenty Seventeen theme and deactivate all plugins and custom code other than Modern Tribe plugins) and see if that helps narrow down the cause of this.

    If it doesn’t, please enable WP_DEBUG and WP_DEBUG_LOG (which will create a file on your server at /wp-content/debug.log if there are any WP_DEBUG messages) and share any debug messages you see while trying to replicate this issue and doing other things on your site relevant to this ticket (such as visiting your site’s home page, events page, single-event pages, and anything else you can think to do).

    Then, please re-share your System Information (while in Testing for Conflicts Mode) in a Private Reply. That will give me a lot of extra information to help troubleshoot this.

    You might also see if you can spot any console errors at your site. (If needed, you may reference our KB article Using Google Chrome Developer Tools.)

    Let us know what you find out.

    Thanks.

    #1288296
    Thomas
    Participant

    Hi Cliff,

    Thanks for your help. I managed to find the error as I switched themes and disabled all other installed plugins.
    It was my fault, by modifiyng the code in order to have a list in the month view instead of a calendar, I deleted the informations that needed to be sent to the Javascript/Json handling the mobile.php and tooltip.php (Even if I don’t use them it still calls the function).

    The code I deleted was this :

    class="<?php tribe_events_the_month_day_classes(); ?>" data-day="<?php echo esc_attr( isset( $daydata['daynum'] ) ? $daydata['date'] : '' ); ?>"
         data-tribejson='<?php echo tribe_events_template_data( null, array( 'date_name' => tribe_format_date( $daydata['date'], false ) ) ); ?>'

    From the loop-grid.php
    It is supposed to surround the single-event.php so I added a <div> with those parameters in order to solve the problem.

    Again, thank you for leading me the right way !

    #1290246
    Cliff
    Member

    I’m glad you’re all sorted now! Thanks for the info, too.

    FYI: Best practice for adding custom code (like to implement a PHP snippet to modify The Events Calendar) is to create a functionality plugin, unless it’s something specific to your theme, in which case best practice is to make sure you’re using a child theme<i>,</i> then add the customization to your child theme’s functions.php file.

    It’s never ideal to modify our plugins’ own files.

    I hope this information helps!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Cannot set property ‘date’ of undefined (Mini calendar on Month view)’ is closed to new replies.