Simpletests on last three items of Basic.ics fail. See notes in parser_ical_feeds.test. All day, day (not time) specified events have timezone correction, and multiple all day events are treated as single day.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lsommerer’s picture

I'm seeing this as well. All day events are being assigned a start time of midnight (as far as I can tell) and are then time zone adjusted.

interhmai’s picture

I'm also seeing this problem. An all day event for march 9th is being set for march 8th at 7pm EST.

David Goode’s picture

Hey! This will only work when using the patched version of date module that supports flexible granularity here: http://drupal.org/node/259308. Hopefully this will roll in some form pretty soon... In the meantime there is no real reliable way of doing this--all-day handling kinda fails in date module when timezone conversion is involved. Once that patch rolls here is the slightly modified patch of parser_ical that takes advantage of it. Also though, the date range with no times is not supported by date_api_ical.inc, as I mention in a comment, so to make that work we'll have to patch that in date module after the other patch rolls. It resets it to a single all-day event.

David Goode’s picture

Status: Active » Postponed
FileSize
1.56 KB

Oops, also would require this patch to feeds to take advantage of it. Once the date stuff gets settled I'll deal with the feeds-related stuff.

interhmai’s picture

Hey. I put all the patches in, but events are still showing up 1 day earlier than their actual times.
Again, if I have an all day event for the 20th, it shows up on the 19th. Before the patches it would show up at 8pm on the 19th.

I reverted back to the regular dev versions and as a quick fix, I changed the ParserIcalFeedsParser.inc

Around line 32 in the All Day event time granularity section,
where it says $this->start->SetTime(0,0,0);

SetTime now takes (17,0,0), which makes the event start at noon on the original event date.

endiku’s picture

I also patched everything and the all day still has the issue of setting back the offset time. However using #5's method it is easy enough to fix in a hacky sort of way. Just make sure to set both
$this->start->setTime(5, 0, 0);
and
$this->end->setTime(5, 0, 0);

so they are the same (in my case 5 offset)

Great work on the patches and hopefully they are in soon.

darrice’s picture

subscribing

ekes’s picture

#259308: Allow "fuzzy" granularity is pretty much stalled for D6 by the look of it.

cybermache’s picture

Does anyone think this has something to do with FeedsParser.inc public function setTimezone() and those of us running on PHP 5.2.6?

points users to this page http://bugs.php.net/bug.php?id=45038

I'm at least receiving these errors when running the feed import script

DateTime::setTimezone() expects parameter 1 to be DateTimeZone, null given in .../sites/all/modules/feeds/plugins/FeedsParser.inc on line 570.

If the timezones isn't being set properly here I could see how a cascade of problems could occur.

brianbrarian’s picture

Here's what I'm using to get interhmai's hack from #5 to take daylight savings time into account:

$event_date = strtotime($feed_element['DTSTART']['datetime']);
$event_year = date('Y', $event_date);
$dls_start = strtotime("Second Sunday March ". $event_year);
$dls_end = strtotime("First Sunday November ". $event_year);
$dls_start = date('Ymd', $dls_start);
$dls_end = date('Ymd', $dls_end);
$event_date = date('Ymd', $event_date);
if($event_date > $dls_start && $event_date < $dls_end) {
  $this->start->setTime(5, 0, 0);
} else {
  $this->start->setTime(6, 0, 0);
}

I suspect there's a more elegant way to do it, but this is the first of the many things I tried that actually worked. Code adapted from: http://drupal.org/node/605730#comment-3800852

meecect’s picture

+subscribing

jberg1’s picture

I've used #5's method (including #6's change to end time) and it seems to be doing the trick. Currently my all day events show up on the proper day with the adjusted start time only.

Wondering if any one would know a way I could have it output "All Day Event" instead of showing the start time?

Thanks for any help you can provide.

manos_ws’s picture

I solved the second part of the problem , the all day treated as a single day applying the patch from the issue #606658: Multiple day VEVENT not working from iCal comment 16

jpamental’s picture

#10 is working like a charm (make sure you set for your own time zone offsets though! 5 and 6 works for US Central time - for Eastern it's 4 and 5)

Will try to work out detection of site time zone and determine offset from there to update as a patch. THANK YOU!!! This has been a HUGE problem in getting Google feeds working.

Jason

abu-zakham’s picture

Issue summary: View changes
FileSize
1.82 KB
abu-zakham’s picture