When importing a single-day all day event from a google calendar feed the logic in ParserVcalendar.inc (comments, line 235) dictates "If the Date All Day module is installed, single-day All Day events will be displayed wrong unless we ignore the DTEND value" and proceeds to return NULL for DTEND. With this rule, my events do not show up in the calendar as the SQL explicitly checks for an end date if Date All Day module is installed. I'm running Date/Date All Day v7.x-2.6 and Calendar 7.x-3.4. In short, i find this rule to be incorrect or (most probably) outdated.

My solution is to just set $property['value'] = $prev_day; (line 247) regardless of whether its a single-day or multi-day all daye event. and that seems to save the events with end dates and correctly display them in the calendar view.

My apologies for not flat-out submitting a patch, but I'm (a) not up to speed on Git and (b) not sure of the correctness of such an action given the complicated interplay of modules and versions.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

coredumperror’s picture

Wow, you're right: rewinding the end date is always the right solution. I never even considered what might happen if the start and end dates were the same value, but having tested it just now, it works fine. So, I applied your suggested change and pushed it to git. I've also attached patches for both the 3.x and 2.x branches to this post.

As for the patch, one thing that's nice about git patches is that you don't need git to create one. Just use diff -u ParserVcalendar.inc.original ParserVcalendar.inc.new > patchfile.patch and it'll create a git-compatible patch file.

coredumperror’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.