• Hi,

    I’m looking for a way to change the default values in the agenda view for the full calendar. Defaults are written in fullcalendar.js and tried changing them there (see code)

    setDefaults({
    	allDaySlot: false,
    	allDayText: 'all-day',
    	firstHour: 7,
    	slotMinutes: 60,
    	defaultEventMinutes: 120,
    	axisFormat: 'h(:mm)tt',
    	timeFormat: {
    		agenda: 'h:mm{ - h:mm}'
    	},

    however this is not working, I already figured out (at least I think so) that defaults are overwritten when the calendar is initialized. However I’m not finding the part where I can change the values.
    I’m using WP FullCalendar in combination with Events Manager.
    Advice from anyone is highly appreciated.

    Cheers

    Robert

    https://www.ads-software.com/plugins/wp-fullcalendar/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Jeroen

    (@jeroenonstenk)

    Hmm, I think I’m experiencing the same problem. Whatever I tried, my settings aren’t set. Any luck so far?

    Plugin Support angelo_nwl

    (@angelo_nwl)

    hi,

    you can try it under wp-fullcalendar/wp-fullcalendar.php at around lines 298-368

    Jeroen

    (@jeroenonstenk)

    Hi Angelo,

    Could you paste a bit of the code in these lines which you a referring to? Around lines 298-368 I don’t see any code similar. Maybe I’m missing something?

    Plugin Support angelo_nwl

    (@angelo_nwl)

    just to confirm, did you mean the time format in the day view?

    Jeroen

    (@jeroenonstenk)

    The time format in day view is ok. But the time shown in axis Format insist on being in am/pm.
    It’s the vertical bar in the left of the screen.

    Plugin Support angelo_nwl

    (@angelo_nwl)

    Jeroen

    (@jeroenonstenk)

    Thanx Angelo!
    Im going to check this out later today!

    Jeroen

    (@jeroenonstenk)

    Hey Angelo,

    I think I miss a file (the one you referred to?) because I don’t have a json.php in my wp-fullcalendar. As you wrote “the file I shared above”; which file do you mean?

    Thnx for your help!

    Plugin Support angelo_nwl

    (@angelo_nwl)

    you can try this lines, wp-fullcalendar/wp-fullcalendar.php at around lines 298-368

    Plugin Support angelo_nwl

    (@angelo_nwl)

    you can try this lines, wp-fullcalendar/wp-fullcalendar.php at around lines 298-368

    Jeroen

    (@jeroenonstenk)

    HI Angelo,

    I’m sorry, but I’m afraid I’m missing something. In wp-fullcalendar/wp-fullcalendar.php at around lines 298-368 I do not see any line that is similar to what this post (https://stackoverflow.com/questions/9080944/24-hour-time-format-so-no-am-to-pm-for-fullcalendar) is talking about.
    That post refers to a json.php and fullCalendar.js. I don’t have a json.php in wp-fullcalendar. And when I change fullCalendar.js according to the best rated answer nothing happens/changes on the frontend.

    Below you’ll see the code in wp-fullcalendar/wp-fullcalendar.php – lines 298-368. Just running the latest version of FullCalendar

    $js_vars['wpfc_locale'] = $calendar_languages[$locale_code_short];
    
    		}
    
    		$js_vars['wpfc_locale']['firstDay'] =  $js_vars['firstDay']; //override firstDay with wp settings
    
    		apply_filters('wpfc_js_vars', $js_vars);
    
    		wp_localize_script('wp-fullcalendar', 'WPFC', $js_vars);
    
    	}
    
    	/**
    
    	 * Catches ajax requests by fullcalendar
    
    	 */
    
    	function ajax(){
    
    	    global $post;
    
    	    //sort out args
    
    	    unset($_REQUEST['month']); //no need for these two
    
    	    unset($_REQUEST['year']);
    
    	    $args = array ('scope'=>array(date("Y-m-d", $_REQUEST['start']), date("Y-m-d", $_REQUEST['end'])), 'owner'=>false, 'status'=>1, 'order'=>'ASC', 'orderby'=>'post_date');
    
    	    //get post type and taxonomies, determine if we're filtering by taxonomy
    
    	    $post_type = !empty($_REQUEST['type']) ? $_REQUEST['type']:'post';
    
    	    $args['post_type'] = $post_type;
    
    	    if( $args['post_type'] == 'attachment' ) $args['post_status'] = 'inherit';
    
    	    $args['tax_query'] = array();
    
    	    foreach( get_object_taxonomies($post_type) as $taxonomy_name ){
    
    	        if( !empty($_REQUEST[$taxonomy_name]) ){
    
    		    	$args['tax_query'][] = array(
    
    					'taxonomy' => $taxonomy_name,
    
    					'field' => 'id',
    
    					'terms' => $_REQUEST[$taxonomy_name]
    
    				);
    
    	        }
    
    	    }
    
    	    //initiate vars
    
    	    $args = apply_filters('wpfc_fullcalendar_args', array_merge($_REQUEST, $args));
    
    		$limit = get_option('wpfc_limit',3);
    
    	    $items = array();
    
    	    $item_dates_more = array();

    Jeroen

    (@jeroenonstenk)

    Ok, I found the solution to change the am/pm settings in agenda week view. I’ve submitted it here: https://www.ads-software.com/support/topic/solution-to-change-ampm-in-week-and-day-agenda-view

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Changing default values for agenda view’ is closed to new replies.