From e4cb0a35ef34b496d8b7e0d6e2e10fe0844e37f8 Mon Sep 17 00:00:00 2001 From: Hivert Quentin Date: Thu, 7 Mar 2024 10:10:10 +0100 Subject: [PATCH] fix(event): fix rdate timezones --- SOPE/NGCards/iCalRepeatableEntityObject.m | 27 ++++++++++++++++------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/SOPE/NGCards/iCalRepeatableEntityObject.m b/SOPE/NGCards/iCalRepeatableEntityObject.m index febd5ad6f..28c8de042 100644 --- a/SOPE/NGCards/iCalRepeatableEntityObject.m +++ b/SOPE/NGCards/iCalRepeatableEntityObject.m @@ -140,14 +140,25 @@ rDate = [rDates objectAtIndex: i]; - if ((rdateTimezone =[rDate timeZone])) - { - //The property rdate can have the timezone, https://www.kanzaki.com/docs/ical/rdate.html - //In that case, dont force the - } - // Example: timezone is -0400, date is 2012-05-24 (00:00:00 +0000), - // and changes to 2012-05-24 04:00:00 +0000 - else if ([theTimeZone isKindOfClass: [iCalTimeZone class]]) + + /* + VERY VERY STRANGE + Sogo seems to handle the date and timezone very strangely + The first event date will be in gmt BUT at the timezone hour + Ex: the event is at 09h15 +0200, the date in sogo will be 09h15 +0000... + So for the rdates, even if they are correct (meaning 07h15 +0000 which is 09h15 +0200) + We will have to set them to have 09h15 +0000 (in thas case it will be 11h15 +0200)... + */ + //the code below was before the fix above + // if ((rdateTimezone =[rDate timeZone])) + // { + // //The property rdate can have the timezone, https://www.kanzaki.com/docs/ical/rdate.html + // //In that case, dont force the + // } + // // Example: timezone is -0400, date is 2012-05-24 (00:00:00 +0000), + // // and changes to 2012-05-24 04:00:00 +0000 + // else + if ([theTimeZone isKindOfClass: [iCalTimeZone class]]) { rDate = [(iCalTimeZone *) theTimeZone computedDateForDate: rDate]; }