From 980b5e28dd0c4cfd42619c64872bb08674d64765 Mon Sep 17 00:00:00 2001 From: smizrahi Date: Tue, 23 Jul 2024 15:21:59 +0200 Subject: [PATCH] fix(calendar): Fix all day recurring event displayed on 2 days when a DST change occurs at the endDate --- UI/Scheduler/UIxCalListingActions.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/UI/Scheduler/UIxCalListingActions.m b/UI/Scheduler/UIxCalListingActions.m index ff6240a82..64025ba58 100644 --- a/UI/Scheduler/UIxCalListingActions.m +++ b/UI/Scheduler/UIxCalListingActions.m @@ -350,8 +350,13 @@ static NSArray *tasksFields = nil; //NSLog(@"***[UIxCalListingActions _fixDates:] %@ = %@ (%i)", aDateField, aDate, daylightOffset); if (daylightOffset) { - aDate = [aDate dateByAddingYears: 0 months: 0 days: 0 hours: 0 - minutes: 0 seconds: daylightOffset]; + // If it is the end date and allday, we need to remove the offset + if ([fields[count * 2] isEqualToString: @"endDate"] && [[theRecord objectForKey: @"c_isallday"] boolValue]) + aDate = [aDate dateByAddingYears: 0 months: 0 days: 0 hours: 0 + minutes: 0 seconds: -1 * daylightOffset]; + else + aDate = [aDate dateByAddingYears: 0 months: 0 days: 0 hours: 0 + minutes: 0 seconds: daylightOffset]; [theRecord setObject: aDate forKey: aDateField]; aDateValue = [NSNumber numberWithInt: [aDate timeIntervalSince1970]]; [theRecord setObject: aDateValue forKey: fields[count * 2 + 1]];