Under Construction conflict with Modern Events Calendar

Hi,

When Modern Events Calendar it’s activated, the under construction bypass setting can’t be used because of a jQuery error: http://prntscr.com/mt0djz
When I noticed this I deactivated MEC and the feature started working fine again, no errors in the console.

I then installed fresh WP on a local environment, installed and activated PRO + MEC + Under Construction and I was able to replicate the same issue.

Can you please fix this?
It will be helpful to share the fix before adding it to the public release.

Thanks,

Hi @carinaa,

I could replicate this issue on my local installation as well.

I’ve added this issue to our bug tracker and it should be fixed in upcoming update cycles.

To temporarily fix this issue, please take a look at this file: ``

  • After that find this code:
        $('#mec_start_date').datepicker(
        {
            changeYear: true,
            changeMonth: true,
            dateFormat: 'yy-mm-dd',
            gotoCurrent: true,
            yearRange: 'c-3:c+5',
        });
        
        $('#mec_end_date').datepicker(
        {
            changeYear: true,
            changeMonth: true,
            dateFormat: 'yy-mm-dd',
            gotoCurrent: true,
            yearRange: 'c-3:c+5',
        });
        
        $('#mec_date_repeat_end_at_date').datepicker(
        {
            changeYear: true,
            changeMonth: true,
            dateFormat: 'yy-mm-dd',
            gotoCurrent: true,
            yearRange: 'c-3:c+5',
        });
        
        $('.mec_date_picker').datepicker(
        {
            changeYear: true,
            changeMonth: true,
            dateFormat: 'yy-mm-dd',
            gotoCurrent: true,
            yearRange: 'c-3:c+5',
        });
  • And change to this:
if( typeof jQuery.fn.datepicker !== "undefined" ){
    
        $('#mec_start_date').datepicker(
        {
            changeYear: true,
            changeMonth: true,
            dateFormat: 'yy-mm-dd',
            gotoCurrent: true,
            yearRange: 'c-3:c+5',
        });
        
        $('#mec_end_date').datepicker(
        {
            changeYear: true,
            changeMonth: true,
            dateFormat: 'yy-mm-dd',
            gotoCurrent: true,
            yearRange: 'c-3:c+5',
        });
        
        $('#mec_date_repeat_end_at_date').datepicker(
        {
            changeYear: true,
            changeMonth: true,
            dateFormat: 'yy-mm-dd',
            gotoCurrent: true,
            yearRange: 'c-3:c+5',
        });
        
        $('.mec_date_picker').datepicker(
        {
            changeYear: true,
            changeMonth: true,
            dateFormat: 'yy-mm-dd',
            gotoCurrent: true,
            yearRange: 'c-3:c+5',
        });
    
}

Hope it helps :slight_smile:

Thank you for providing the fix.
You forgot to add the filename :slight_smile:

Hi There,

Sorry, the events.js file locates under:

⁨wp-content⁩ ▸ ⁨plugins⁩ ▸ ⁨modern-events-calendar⁩ ▸ ⁨assets⁩ ▸ ⁨js

Regards!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.