RRuleSwift icon indicating copy to clipboard operation
RRuleSwift copied to clipboard

Fixed the timezone related freeze

Open sunnymango opened this issue 6 years ago • 0 comments

Problem: The DateFormatter has a feature that will add the AM/PM to any formatted string (even if the format doesn't include AM/PM) if the user sets his/her phone to a 24-hour region, like Great Britain, and then toggle on the 24-Hour Time switch, and then toggle off.

Solution: Use a region that is not broken, for example the US region in a safe init method.

Reference: https://stackoverflow.com/questions/6613110/what-is-the-best-way-to-deal-with-the-nsdateformatter-locale-feechur

sunnymango avatar Jun 20 '18 00:06 sunnymango