diff --git a/SoObjects/Appointments/iCalEvent+SOGo.m b/SoObjects/Appointments/iCalEvent+SOGo.m index d269d62bd..dbb857ab4 100644 --- a/SoObjects/Appointments/iCalEvent+SOGo.m +++ b/SoObjects/Appointments/iCalEvent+SOGo.m @@ -1,6 +1,6 @@ /* iCalEvent+SOGo.m - this file is part of SOGo * - * Copyright (C) 2007-2015 Inverse inc. + * Copyright (C) 2007-2016 Inverse inc. * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,6 +32,7 @@ #import #import +#import #import #import #import @@ -366,7 +367,7 @@ isAllDay = [[data objectForKey: @"isAllDay"] boolValue]; - if (aptStartDate && aptEndDate) + if (aptStartDate && aptEndDate && [aptStartDate earlierDate: aptEndDate] == aptStartDate) { if (isAllDay) { @@ -380,7 +381,7 @@ [[self parent] removeChild: tz]; } - nbrDays = ((float) abs ([aptEndDate timeIntervalSinceDate: aptStartDate]) / 86400) + 1; + nbrDays = round ([aptEndDate timeIntervalSinceDate: aptStartDate] / 86400) + 1; timeZone = [aptStartDate timeZone]; offset = [timeZone secondsFromGMTForDate: aptStartDate]; allDayStartDate = [aptStartDate dateByAddingYears: 0 months: 0 days: 0