mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-11-22 07:14:21 +00:00
Monotone-Parent: 09e07a1c8e00beee8c2f4bdeebb726ac5f57b9e9
Monotone-Revision: 8e38cd34311edbce1f6a5d645e0e49644ad94473 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-10-19T02:59:09 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
1 parent
6484ed17fe
commit
1bd2798ae8
2 files changed
+17
-4
No files matched your search
@@ -1,5 +1,9 @@
|
||||
2010-10-18 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* iCalTimeZone.m (-dateForDateTimeString:): adjust dates since
|
||||
they are passed as UTC and may not match the timezone's DST
|
||||
switches. A bit dirty but good for now...
|
||||
|
||||
* iCalTimeZonePeriod.m (_occurenceForDate:byRRule:): we don't need
|
||||
to deduct the offset from UTC from the resulting date since
|
||||
"tzStart" is already relative to UTC.
|
||||
|
||||
@@ -220,14 +220,23 @@ static NSMutableDictionary *cache;
|
||||
- (NSCalendarDate *) dateForDateTimeString: (NSString *) string
|
||||
{
|
||||
NSCalendarDate *tmpDate;
|
||||
iCalTimeZonePeriod *period;
|
||||
iCalTimeZonePeriod *period, *realPeriod;
|
||||
|
||||
tmpDate = [string asCalendarDate];
|
||||
period = [self periodForDate: tmpDate];
|
||||
tmpDate = [tmpDate addYear: 0 month: 0 day: 0
|
||||
hour: 0 minute: 0
|
||||
second: -[period secondsOffsetFromGMT]];
|
||||
|
||||
return [tmpDate addYear: 0 month: 0 day: 0
|
||||
hour: 0 minute: 0
|
||||
second: -[period secondsOffsetFromGMT]];
|
||||
#warning this is a dirty hack due to the fact that the date is first passed as UTC
|
||||
realPeriod = [self periodForDate: tmpDate];
|
||||
if (realPeriod != period)
|
||||
tmpDate = [tmpDate addYear: 0 month: 0 day: 0
|
||||
hour: 0 minute: 0
|
||||
second: ([period secondsOffsetFromGMT]
|
||||
- [realPeriod secondsOffsetFromGMT])];
|
||||
|
||||
return tmpDate;
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in new issue
Block a user