• maxoud

    (@maxoud)


    Using the Events Maker’s Settings -> Display panel it’s impossible to set up right time format for the Agenda view time column and the first week day. That’s due to wrong Full Calendar settings hardcoded.

    Here is the solution that works for the Events Maker v.1.6.14 using obsolete version 2.4.0 of the Full Calendar.

    
    <?php
    function fix_fullcalendarjs_args($args) {
    
    	$em_gen_opt = get_option( 'events_maker_general' );
    
    	$first_weekday = ( $em_gen_opt['first_weekday'] === 7 ? 0 : 1 );
    
    	$axis_format = str_replace( array( 's', 'i', 'H', 'h', 'G', 'g' ), array( 'ss', 'mm', 'H', 'hh', 'H', 'h' ), $em_gen_opt['datetime_format']['time'] );
    
    	$args['firstDay'] = $first_weekday;
    	$args['slotLabelFormat'] = $axis_format;
    	// Was not originally used in EM, but already deprecated:
    	// $args['axisFormat'] = $axis_format;
    
    	return $args;
    }
    
    add_filter( 'em_get_full_calendar_script_args', 'fix_fullcalendarjs_args' );
    

    Full Calendar docs on the issue.

    • This topic was modified 7 years ago by maxoud.
    • This topic was modified 7 years ago by maxoud.
    • This topic was modified 7 years ago by maxoud.
  • The topic ‘[Solution] Calendar does not respect time format and first weekday’ is closed to new replies.