Home › Forums › Calendar Products › Events Calendar PRO › Cannot set property ‘date’ of undefined (Mini calendar on Month view)
- This topic has 4 replies, 3 voices, and was last updated 8 years, 11 months ago by
Cliff.
-
AuthorPosts
-
May 23, 2017 at 8:12 am #1287673
Thomas
ParticipantHi,
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.
May 23, 2017 at 7:05 pm #1288104Cliff
MemberHi, 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?
- Downloads / Version Numbers
- License Keys
- TEC Automatic Updates
- or TEC Manual Updates
- WordPress core updates
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.
May 24, 2017 at 7:46 am #1288296Thomas
ParticipantHi 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 !
May 29, 2017 at 3:44 am #1290246Cliff
MemberI’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!
-
AuthorPosts
- The topic ‘Cannot set property ‘date’ of undefined (Mini calendar on Month view)’ is closed to new replies.
