iCal feed adds one minute to end time

Home Forums Calendar Products Events Calendar PRO iCal feed adds one minute to end time

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #20001
    Jen
    Participant

    In the Outlook calendar feed, all my events have an extra minute added to them. (For instance, an event ends at 6:00 p.m., but Outlook shows 6:01 p.m.) Also, events without a specified venue are shown in Outlook with a location of “United States.” (This is almost certainly related to this issue: https://theeventscalendar.com/support/forums/topic/modify-venue-options/)

    I haven’t investigated workarounds yet (and may not bother to do so), but I just wanted to report the bugs to the development team.

    #20009
    Jen
    Participant

    OK, nevermind on the “United States” thing. It only affects the events created before I updated my version of Pro to 2.0.6. The extra minute is still an issue, though.

    #20056
    Rob
    Member

    Hi there Jen. Thanks for the heads up; sounds like the “United States” issue is resolved, but the minutes one is certainly a concern. Does this occur when you change your time zone settings for the WP site? Specifically, going either to a UTC offset if you weren’t previously; or moving away from a UTC offset if you were on it? My guess is that this is somehow related to that and I’d like to see if we can prove that.

    Let me know and I’ll try to get this resolved. Even though it’s just 1 minute, that would be worth cleaning up if we can identify the cause.

    #20254
    Jen
    Participant

    I haven’t changed by UTC settings at all. I looked at the raw iCal feed, and it looks like it’s adding 59 seconds to the end of the time, which is getting rounded up to a full minute. So for instance, on an event that is ending at 7 p.m., the code reads “DTEND;VALUE=DATE-TIME:20120627T190059.”

    #20292
    Rob
    Member

    Ah, thanks for confirming as much, Jen. We’ve got a couple folks here on the forum who are better versed in iCal than I. Let me see if Andy, who has written a couple patches so far, can identify if this is a bug he thinks we can easily address in next month’s monthly maintenance release.

    Stay tuned and thanks for your patience.

    #20310
    Andy Fragen
    Moderator

    I’ll dig a little when I get the chance. @Jen – can you post a link to your calendar?

    #20311
    Jen
    Participant
    #20313
    Andy Fragen
    Moderator

    @Jen – I see exactly what you’re referring to in my feeds as well. I think I know both where this is coming from and how to fix but it doesn’t really make sense. There is a line that adds a day (in seconds) to the end of an event $endDate, there’s a code reference about it being necessary for a “bug” in iCal.

    I’ll code up a quick patch for your theme’s functions.php file. Out of curiousity, are you having similar issues with Outlook as described in https://theeventscalendar.com/support/forums/topic/ical-import-how-do-we-get-it-to-add-event-to-an-existing-calendar-in-outlook/ ?

    #20343
    Andy Fragen
    Moderator

    Here’s the solution. I’ve tested against all day events and it leaves those alone. 😉 It will replace the ending “59” with a “00”. Add to your theme’s functions.php file and you should be good to go.

    https://gist.github.com/2893002

    #20344
    Andy Fragen
    Moderator

    @Rob, if you want to ‘fix’ something in the core I’d look at the following mod.


    $endDate = date( 'Ymd', $endDateStamp + 86400 );

    to


    $endDate = date( 'Ymd', $endDateStamp + (86400 - 59) );

    #20365
    Andy Fragen
    Moderator

    @Rob, I’ve looked through as much of the code as I can and I really don’t see why a extra 59 sec is added to the duration of an event. I do have a better solution than the one above. In the function iCalFeed use the following 2 lines where the first line is currently. There are no changes to the first line.


    $duration = TribeDateUtils::timeBetween( $eventPost->EventStartDate, $eventPost->EventEndDate );
    $duration = ( intval( $duration / 60 ) * 60 );

    #20367
    Andy Fragen
    Moderator

    @Rob, FYI $eventPost->EventEndDate is where the extra 59 seconds come from.

    #20384
    Rob
    Member

    Thanks for the heads up here, Andy – and for identifying what was up here. Let me get Paul to take a look at this and if it is something we can easily integrate into the code, we will do it for next month’s maintenance release. It does appear based on what you’ve noted and Jen’s problem that we were adding that duration unnecessarily…

    Jen, you tried Andy’s suggestion? Any luck on your end?

    #20556
    Dave Meyer
    Participant

    I’m seeing the exact same issue on one of our sites. I’m following this thread to see if Andy’s fix works for Jen.

    #20567
    Andy Fragen
    Moderator

    Aw come on Vince. Let us know if it works for you. 😉 It works for me, but I don’t have it added to an Outlook calendar.

Viewing 15 posts - 1 through 15 (of 17 total)
  • The topic ‘iCal feed adds one minute to end time’ is closed to new replies.