multi day events are not on the correct dates

It runs, but it doesn't show the right information

multi day events are not on the correct dates

Postby hewittnbut » Tue Nov 17, 2009 11:34 am

For some reason on our phpicalendar installation, multi day events are not showing the correct dates. We have a .ics file and the dates for the event are correct. For example, here is one of our events in the .ics file:

Code: Select all
BEGIN:VEVENT
DTSTART;VALUE=DATE:20091125
DTEND;VALUE=DATE:20091128
DTSTAMP:20091116T135003Z
UID:CSVConvertefc3a6054495ea96d07408797799cddd
CREATED:19000101T120000Z
DESCRIPTION:
LAST-MODIFIED:20091103T065028Z
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Thanksgiving Vacation - Buildings Closed
TRANSP:OPAQUE
END:VEVENT


The event should start on 11/25 and end on 11/28. However, on the PHPicalendar install, it is displaying that event as starting on 24 from 12:00 a.m. - 12:00 a.m. and ending on 11/26 from 12:00 a.m. - 12:00 a.m. As you can see, those are not the correct dates from the .ics file. Is PHPicalendar parsing the multi day event weird? How would I go about fixing this or where would I even start looking in the code?

Thanks in advance for the help. I am on PHPicalendar V2.31 and we are importing the .ics from google into phpicalendar.
hewittnbut
Member
 
Posts: 2
Joined: Tue Nov 17, 2009 11:07 am

Re: multi day events are not on the correct dates

Postby VitoDonCorleone » Tue Mar 09, 2010 1:34 am

I have the same problem with a multiday event. There are two events in two different calenders. Both start at 2010/08/03 and end at 2010/09/03. The second event is drawing on the wrong date 2010/10/03.

Calender B - Visitations
BEGIN:VEVENT
SUMMARY: Besuch: Audit
DESCRIPTION:Audit
CREATED;TZID=Europe/Vienna:20091201T114400Z
LAST-MODIFIED;TZID=Europe/Vienna:20100223T084153Z
USER-CREATED:username
USER-LAST-MODIFIED:username
NOTICE:
UID:../calendars/1BE.ics>20091201T114400Z
DTSTART;TZID=Europe/Vienna:20100308T140000Z
DTEND;TZID=Europe/Vienna:20100309T123000Z
COMPANY:companyname
CONTACT:user1, user2
DTSTAMP;TZID=Europe/Vienna:20100223T084153Z
END:VEVENT

Calendar PR - PresentationRoom
BEGIN:VEVENT
SUMMARY: Audit
DESCRIPTION:Audit
CREATED;TZID=Europe/Vienna:20100223T084209Z
LAST-MODIFIED;TZID=Europe/Vienna:20100223T084209Z
USER-CREATED:username
USER-LAST-MODIFIED:username
NOTICE:
UID:../calendars/4BRR-PR.ics>20100223T084209Z
DTSTART;TZID=Europe/Vienna:20100308T140000Z
DTEND;TZID=Europe/Vienna:20100309T123000Z
CONTACT:user1,user2
REASON:Audit
DTSTAMP;TZID=Europe/Vienna:20100223T084209Z
END:VEVENT


If I show only one calendar everything looks perfect. But with 2 calenders displayed the event shows one day late. I think it's a problem with calculating the colspans in template.php -> draw_week() -> $nbrGridcols (?)

Image
VitoDonCorleone
Member
 
Posts: 3
Joined: Thu Feb 18, 2010 9:52 am

Re: multi day events are not on the correct dates

Postby Parasyte » Thu Mar 11, 2010 10:14 am

That looks like version 2.4 from CVS. Is that right?
Parasyte
Member
 
Posts: 165
Joined: Thu Jan 15, 2009 4:31 pm

Re: multi day events are not on the correct dates

Postby VitoDonCorleone » Thu Mar 11, 2010 11:15 am

Hi,
sorry forgot to mention the version. It's the official 2.31 of phpicalendar. I tried to get the newest one from sourceforge cvs, but with eclipse I always get a timeout error :evil: .

Do you know the problem with the week view? I created a bug at sourceforge too. Thanks for your reply so far!
VitoDonCorleone
Member
 
Posts: 3
Joined: Thu Feb 18, 2010 9:52 am

Re: multi day events are not on the correct dates

Postby Parasyte » Tue Mar 16, 2010 11:11 am

Well it could already be fixed in CVS. There's an older version of 2.4 (alpha) available here on the forums: viewtopic.php?f=47&t=3484#p13384 You could try that, see if it helps at all.
Parasyte
Member
 
Posts: 165
Joined: Thu Jan 15, 2009 4:31 pm

Re: multi day events are not on the correct dates

Postby VitoDonCorleone » Thu Mar 18, 2010 8:59 am

Thanks for the link. If I try to download I get the following message:

The selected attachment does not exist anymore.
The file ./../files/8620_8ad12fc21e743c343143d58046f8acc4 does not exist.


I opened a ticket at sourceforge to have a look at the cvs login. Tried it with eclipse, putty, winscp, tortoisecvs without success.
VitoDonCorleone
Member
 
Posts: 3
Joined: Thu Feb 18, 2010 9:52 am

Re: multi day events are not on the correct dates

Postby Parasyte » Wed Mar 24, 2010 12:33 pm

Not able to connect to CVS with any of those clients? Could it be a restriction on your network? Firewall policies, maybe? Have you seen this page? https://sourceforge.net/apps/trac/sourc ... structions especially the part at the bottom, "Configuring CVS Around a Firewall."
Parasyte
Member
 
Posts: 165
Joined: Thu Jan 15, 2009 4:31 pm

Re: multi day events are not on the correct dates

Postby Parasyte » Thu Apr 15, 2010 2:46 pm

VitoDonCorleone,

I can verify this happens. I think I can fix it in time for 2.4 final release. (I'm planning to release tomorrow.) This might be easy enough to fix, I'll be working on it today.
Parasyte
Member
 
Posts: 165
Joined: Thu Jan 15, 2009 4:31 pm

Re: multi day events are not on the correct dates

Postby Parasyte » Thu Apr 15, 2010 3:37 pm

VitoDonCorleone,

Please try this patch. This will be included in 2.4 RC5.

Code: Select all
--- functions/draw_functions.php   8 Jul 2009 18:28:13 -0000   1.10
+++ functions/draw_functions.php   15 Apr 2010 20:34:24 -0000
@@ -31,7 +31,12 @@ function drawEventTimes ($start, $end, $
         $end_min = "00";
      }
   }
-   $draw_len = ($end_h * 60 + $end_min) - ($sta_h * 60 + $sta_min);
+   $sta = ($sta_h * 60 + $sta_min);
+   $end = ($end_h * 60 + $end_min);
+   if ($sta < $end)
+      $draw_len = $end - $sta;
+   else
+      $draw_len = $sta - $end;

   return array ("draw_start" => ($sta_h . $sta_min), "draw_end" => ($end_h . $end_min), "draw_length" => $draw_len);
}
--- functions/parse/overlapping_events.php   8 Jul 2009 18:28:13 -0000   1.4
+++ functions/parse/overlapping_events.php   15 Apr 2010 20:34:25 -0000
@@ -110,7 +110,7 @@ function flatten_ol_blocks($event_date,

// Builds $overlap_array structure, and updates event_overlap in $master_array for the given events.
   // For a given date,
-   //    - check to see if the event's already in a block, and if so, add it.
+   // - check to see if the event's already in a block, and if so, add it.
   //      - make sure the new block doesn't overlap another block, and if so, merge the blocks.
   // - check that there aren't any events we already passed that we should handle.
   //      - "flatten" the structure again, merging the blocks.
@@ -182,7 +182,9 @@ function checkOverlap($event_date, $even
         foreach ($time as $loop_event_key => $loop_event) {
            // Make sure we haven't already dealt with the event, and we're not checking against ourself.
            if ($loop_event['event_overlap'] == 0 && $loop_event_key != $uid) {
-               $loopDrawTimes = drawEventTimes($loop_event['event_start'], $loop_event['display_end']);
+               $loopDrawTimes = drawEventTimes($loop_event['event_start'], $loop_event['display_end'], ($loop_event['event_length'] >= (60*60*24)));
+               if ($event_time == "0000") $loopDrawTimes['draw_start'] = "0000";
+               if ($draw_end == "2400") $loopDrawTimes['draw_end'] = "2400";
               if ($loopDrawTimes['draw_start'] < $drawTimes['draw_end'] && $loopDrawTimes['draw_end'] > $drawTimes['draw_start']) {
                  if ($loopDrawTimes['draw_start'] < $drawTimes['draw_start']) {
                     $block_start = $loopDrawTimes['draw_start'];
Parasyte
Member
 
Posts: 165
Joined: Thu Jan 15, 2009 4:31 pm

Re: multi day events are not on the correct dates

Postby Parasyte » Fri Apr 16, 2010 2:28 pm

I had to add one more patch on top of the previous one:

Code: Select all
--- end_vevent.php   2009/07/08 18:28:13   1.27
+++ end_vevent.php   2010/04/16 19:10:17   1.28
@@ -326,7 +326,8 @@
         $master_array[$this_date_tmp][$time_key][$uid] = array (
            'event_start' => $start_time,                   # hhmm
            'event_end' => $end_time,                       # hhmm
-            'display_end' => $display_end_tmp,               # hhmm display_start is $time_key
+            'display_start' => $time_key,                   # hhmm
+            'display_end' => $display_end_tmp,               # hhmm
            'start_unixtime' => $start_unixtime_tmp,         # start unixtime for this recurrence
            'end_unixtime' => $end_unixtime_tmp,             # end unixtime for this recurrence
            'event_text' => $summary,                       #
--- overlapping_events.php   2010/04/15 20:36:15   1.5
+++ overlapping_events.php   2010/04/16 19:10:17   1.6
@@ -138,11 +138,7 @@
   $event = $master_array[$event_date][$event_time][$uid];
   // Copy out the array - we replace this at the end.
   $ol_day_array = @$overlap_array[$event_date];
-   $draw_end = $event['event_end'];
-   if (isset($event['display_end'])) $draw_end = $event['display_end'];
-   $drawTimes = drawEventTimes($event['event_start'], $draw_end, ($event['event_length'] >= (60*60*24)));
-   if ($event_time == "0000") $drawTimes['draw_start'] = "0000";
-   if ($draw_end == "2400") $drawTimes['draw_end'] = "2400";
+   $drawTimes = drawEventTimes($event['display_start'], $event['display_end'], ($event['event_length'] >= (60*60*24)));

   // Track if $event has been merged in, so we don't re-add the details to 'event' or 'overlapRanges' multiple times.
   $already_merged_once = false;
@@ -182,9 +178,7 @@
         foreach ($time as $loop_event_key => $loop_event) {
            // Make sure we haven't already dealt with the event, and we're not checking against ourself.
            if ($loop_event['event_overlap'] == 0 && $loop_event_key != $uid) {
-               $loopDrawTimes = drawEventTimes($loop_event['event_start'], $loop_event['display_end'], ($loop_event['event_length'] >= (60*60*24)));
-               if ($event_time == "0000") $loopDrawTimes['draw_start'] = "0000";
-               if ($draw_end == "2400") $loopDrawTimes['draw_end'] = "2400";
+               $loopDrawTimes = drawEventTimes($loop_event['display_start'], $loop_event['display_end'], ($loop_event['event_length'] >= (60*60*24)));
               if ($loopDrawTimes['draw_start'] < $drawTimes['draw_end'] && $loopDrawTimes['draw_end'] > $drawTimes['draw_start']) {
                  if ($loopDrawTimes['draw_start'] < $drawTimes['draw_start']) {
                     $block_start = $loopDrawTimes['draw_start'];


Otherwise, it broke when even more events were added.
Parasyte
Member
 
Posts: 165
Joined: Thu Jan 15, 2009 4:31 pm


Return to Setup and display problems

Who is online

Users browsing this forum: No registered users and 1 guest