Plans - Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist     RegisterRegister  ProfileProfile   Log inLog in
Fix for the Outlook import add-in (plans_import.pl)

 
Post new topic   Reply to topic    Plans - Forum Forum Index » Problems
View previous topic :: View next topic  
Author Message
Loccy



Joined: 28 Feb 2006
Posts: 1

PostPosted: Tue Feb 28, 2006    Post subject: Fix for the Outlook import add-in (plans_import.pl) Reply with quote

Hi all,

Having had problems importing various Outlook calendars into Plans as a result of All Day Events getting mangled, I took a look at the code and was able to fix it.

Find the line

$event_end_timestamp = timegm(59,59,11,$end_mday,$end_month,$end_year);

and replace it with the two lines

$event_end_timestamp = timegm(59,59,23,$end_mday,$end_month,$end_year);
$event_end_timestamp = $event_end_timestamp - 86400;

Some notes for the curious:

The correction in the first line is because of what was probably an oversight on the original author's part (he's ending the all day event at 11:59AM and not 11:59PM or 23:59!). The second line is needed because all day events in Outlook are represented as an event that lasts from midnight to midnight. However what this means is that, strictly speaking, an Outlook all day event does actually span TWO days in that it runs into the second day by one second.

So, for example, if you had an all day event on Outlook that lasted one day, the 1st January, it would come in with a start time/date of January 1st 00:00, and it would finish on January 2nd 00:00.

However, plans_import.pl doesn't take the second point into account. So you end up with an all day event that goes on for an extra day.

So we simply declare the finishing date of the All Day Event to be 11:59:59 on the original finishing date (which will be a day on from what the finishing date SHOULD be), and we then deduct 86400 seconds to compensate for the extra erronenous day.
Back to top
View user's profile Send private message
daltonlp
Site Admin


Joined: 24 Nov 2003
Posts: 1499

PostPosted: Thu Mar 02, 2006    Post subject: Reply with quote

This fix has been made. Thanks!

- Lloyd
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Plans - Forum Forum Index -> Problems All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group / Oranja by Lessthaneric.net