简体   繁体   中英

Creating RRULE for local timezone in iOS

RRULE requires specific information for when timezone changes between standard and daylight time. This information originally comes from the Olson database, and I suspect that it is available in the data property of the NSTimeZone class. But how do I get the structure of this property?

The public methods of NSTimeZone seem insufficient to make a complete RRULE for timezone transitions.

Creating an ical with an RDATE block but not RRULE block results in Exchange complaining of an invalid format.

Any suggestions on how to resolve this?

如果我没有错,那么您可以使用以下代码: https//github.com/FabienDiTore/ios-rrule_parserhttps://github.com/jochenschoellig/RRULE-to-EKRecurrenceRule

I ended up creating a method that uses nextDaylightSavingTransitionAfterDate: to find transition dates a year apart (if they exist). Once these are found, an NSDateComponents object is created for each so the dates can be compared to infer a repeat rule. I considered only matches that occurred in the same month, then checked for either same day number of same day of week. If same day of week, I checked the ordinality of the weekday within the month to create the rule.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM