Home › Forums › Calendar Products › Events Calendar PRO › iCal feed adds one minute to end time
- This topic has 16 replies, 4 voices, and was last updated 11 years, 10 months ago by Rob.
-
AuthorPosts
-
May 31, 2012 at 12:32 pm #20001JenParticipant
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.
May 31, 2012 at 2:46 pm #20009JenParticipantOK, 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.
June 1, 2012 at 12:26 pm #20056RobMemberHi 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.
June 6, 2012 at 12:33 pm #20254JenParticipantI 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.”
June 6, 2012 at 8:03 pm #20292RobMemberAh, 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.
June 7, 2012 at 9:07 am #20310Andy FragenModeratorI’ll dig a little when I get the chance. @Jen – can you post a link to your calendar?
June 7, 2012 at 9:08 am #20311JenParticipantJune 7, 2012 at 9:32 am #20313Andy FragenModerator@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/ ?
June 7, 2012 at 7:16 pm #20343Andy FragenModeratorHere’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.
June 7, 2012 at 7:23 pm #20344Andy FragenModerator@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) );
June 8, 2012 at 9:43 am #20365Andy FragenModerator@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 );
June 8, 2012 at 9:52 am #20367Andy FragenModerator@Rob, FYI $eventPost->EventEndDate is where the extra 59 seconds come from.
June 8, 2012 at 11:30 am #20384RobMemberThanks 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?
June 12, 2012 at 8:58 am #20556Dave MeyerParticipantI’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.
June 12, 2012 at 4:37 pm #20567Andy FragenModeratorAw 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.
-
AuthorPosts
- The topic ‘iCal feed adds one minute to end time’ is closed to new replies.