Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DateFormatter object from NSDate.cachedObjectInCurrentThread is modified causing different return results from some functions. #69

Closed
wfilleman opened this issue Nov 3, 2015 · 1 comment

Comments

@wfilleman
Copy link

Hello,

Thank you for this excellent library. It certainly does make working with dates quite a bit more pleasant.

Ran into an issue where calling .toISOString() changes the dateFormatter timezone and date format from the default/cached dateFormetter. Subsequent calls to .toShortString(), for example, ends up using the modified dateFormatter from .toISOString() resulting in unexpected short/medium/long string prints of the time now based on UTC instead of the user's local timezone.

Once suggestion is to always set the dateFormatter defaults each time the dateFormatter object is retrieved or make sure each func that modifies the cachedDateFormatter returns it back to the "found" state.

Wes

@malcommac
Copy link
Owner

We have fixed it with SwiftDate 2. Thank you for your report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants