-
-
Notifications
You must be signed in to change notification settings - Fork 202
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
Fix date decoding error #140
Conversation
let formatter = DateFormatter() | ||
formatter.locale = Locale(identifier: "en_US_POSIX") | ||
formatter.timeZone = TimeZone(secondsFromGMT: 0) | ||
formatter.calendar = Calendar(identifier: .iso8601) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be enough to set this calendar? Do we really need the timezone and locale setting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we set only the calendar
parameter, then locale
and timeZone
will stay by default (according to the user iOS Settings). And for ISO8601-like DateFormatter it's expected en_US_POSIX
locale and GMT
timeZone. I think it would be more stable that way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, makes sense! Thanks for the detailed explanation 🙂
AppStoreConnect_Swift_SDK.framework: Coverage: 80.82
Generated by 🚫 Danger Swift against 560389c |
Congratulations! 🎉 This was released as part of Release 1.5.0 🚀 Generated by GitBuddy |
There was frequently an error
Failed to decode response
. This fix should help, at least after a month of observing I didn't see that error appeared again.