• ResolvedPlugin Contributor contemplate

    (@contemplate)


    While testing importing the iCal into non-Apple calendars I consistently get errors. When I run the iCal feed through a validator it throws errors like this:
    Error at line 11:Cannot set timezone for UTC

    It points to DSTAMP and the way the plugin uses timezones. Then I found a bunch of articles pointing to the need for only using the Z format.

    So I’m suggesting these changes:

    change this

    
    $start_time = date( 'Ymd\THis', get_post_time( 'U', false, $post->ID ) );
    $end_time = date( 'Ymd\THis', get_post_time( 'U', false, $post->ID ) + ($options['icalfeeds_minutes'] * 60));
    

    to this:

    
    $start_time = date( 'Ymd\THis', get_post_time( 'U', true, $post->ID ) );
    $end_time = date( 'Ymd\THis', get_post_time( 'U', true, $post->ID ) + ($options['icalfeeds_minutes'] * 60));
    

    And then change this:

    
    $modified_time = date( 'Ymd\THis', get_post_modified_time( 'U', false, $post->ID ) );
    

    to this:

    
    $modified_time = date( 'Ymd\THis', get_post_modified_time( 'U', true, $post->ID ) );
    

    and finally change this:

    
    if ($timezone === 'UTC') {
                $start_time = ":$start_time" . 'Z';
                $end_time = ":$end_time" . 'Z';
                $modified_time = ":$modified_time" . 'Z';
    } else {
                $start_time = ";TZID=$timezone:$start_time";
                $end_time = ";TZID=$timezone:$end_time";
                $modified_time = ";TZID=$timezone:$modified_time";
    }
    

    to this:

    
    $start_time = ":$start_time" . 'Z';
    $end_time = ":$end_time" . 'Z';
    $modified_time = ":$modified_time" . 'Z';
    

    Hope that helps.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fixing Validation Errors’ is closed to new replies.