Fullcalendar js adjusting

This topic contains 3 replies, has 2 voices, and was last updated by  Stephen Harris 7 years, 1 month ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #29402

    I needed to add a date parameter to the url in the fullcalendar js, this works fine.

        return '<a class="' + classes.join(' ') + '"' +
                (event.url ? /// DATE param adjusted and the format
                    ' href="' + htmlEscape(event.url) + '?date=' + htmlEscape(this.getEventTimeText( event, "MMMM D, YYYY")) + '"' : 
                    ''
                    ) +
    

    I replaced the script using the modified version like this and it works fine, do you foresee issues with this?

    add_action( 'init', 'joy_replace_eo_fullcalendar_with_custom_version', 0 ); 
    /** 
     * Replace Full Calendar js from Event Organiser plugin with custom version.
     */
    function joy_replace_eo_fullcalendar_with_custom_version() {
    
        global $wp_locale;
        $version = defined( 'EVENT_ORGANISER_VER' ) ? EVENT_ORGANISER_VER : false;
    
        wp_register_script( 'eo_fullcalendar', ASSETS_URL . 'js/eo-joy-fullcalendar.packed.js',array(
            'jquery',
            'eo_momentjs',
            'jquery-ui-core',
            'jquery-ui-widget',
            'jquery-ui-button',
    
        ), $version, true );
    
    
    }
    
    Joy Katzen-Guthrie
    #29403

    Also, thank you for replying during the holidays. I’m trying to get a head now because family visits this week when everyone else is back at work.

    BTW, I’m not Joy, my name is Christina. Joy is my client.

    Joy Katzen-Guthrie
    #29404

    At some point, it’d be nice to have a filter to add variables to the jQuery. I am grateful for the eventorganiser_event_tooltip filter for the qtip content.

    Joy Katzen-Guthrie
    #29418

    You’re welcome :).

    There’s a filter for changing the event URL: http://codex.wp-event-organiser.com/hook-eventorganiser_calendar_event_link.html

    As with the tooltip, the calendar is cached, so changes are not immediate (you can update an event to clear the cache).

    Something like this should work:

    add_filter('eventorganiser_calendar_event_link', function($link, $event_id, $occurrence_id){
        $date = eo_get_the_start( 'Y-m-d', $event_id, $occurrence_id );
        return add_query_arg( 'date', $date, $link );
    }, 10, 3);
    
    Stephen Harris
Viewing 4 posts - 1 through 4 (of 4 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.