Facebook Event didn’t import event time, import as allday event

Home Forums Calendar Products Event Aggregator Facebook Event didn’t import event time, import as allday event

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #789272
    Christian Kramer
    Participant

    Hi,

    since the update to version 3.8 Facebook event were not imported with the time saved in Facebook. Instead of this the events are be imported as allday events, starting with the start date and ending with the day after the event.

    A big or a feature? 😉

    Thanks for a hint.
    Chris

    #791625
    Barry
    Member

    Hi Chris,

    Seems like a bug to me – and I’ll log it for further attention. In the meantime, could you try adding the following snippet to your theme’s functions.php file?

    add_filter( 'tribe_fb_determine_if_is_all_day', 'correct_imported_fb_all_day_status', 10, 3 );
    
    function correct_imported_fb_all_day_status( $all_day, $start_time, $end_time ) {
    	if ( ! $all_day ) return $all_day;
    
    	try {
    		$start_time = new DateTime( $start_time );
    		$start_time = $start_time->format( TribeDateUtils::TIMEFORMAT );
    
    		if ( $start_time !== '12:00 AM' ) {
    			add_filter( 'tribe_fb_parse_facebook_event', 'fb_correct_end_time_to_start_time' );
    			return false;
    		}
    
    		return $all_day;
    	}
    	catch ( Exception $e ) {
    		return $all_day;
    	}
    }
    
    function fb_correct_end_time_to_start_time( array $args ) {
    	$args['EventEndHour'] = $args['EventStartHour'];
    	$args['EventEndMinute'] = $args['EventStartMinute'];
    	$args['EventEndMeridian'] = $args['EventStartMeridian'];
    	return $args;
    }

    This should help to correct things until we can get a substantive fix together (definitely let me know if it doesn’t help though).

    Thanks!

    #824577
    Barry
    Member

    Hi! It’s been a while so I’m going to go ahead and close this thread (though we’ll re-open and post an update as work on the bug progresses). If we can help with anything else, though, please don’t hesitate to create new threads as needed. Thanks!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Facebook Event didn’t import event time, import as allday event’ is closed to new replies.