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

toISODate(region:) ignores explicitly passed Region #670

Closed
ifabijanovic opened this issue May 6, 2019 · 2 comments
Closed

toISODate(region:) ignores explicitly passed Region #670

ifabijanovic opened this issue May 6, 2019 · 2 comments
Assignees
Labels
Milestone

Comments

@ifabijanovic
Copy link

ifabijanovic commented May 6, 2019

Parsing a date string that contains only a date component using the ISO formatter with region specified ignores the passed in region and returns in GMT.

Local region is - gregorian, America/New_York, en_US
2019-05-06.toISODate(region: .local) returns DateInRange in GMT timezone
2019-05-06.toDate(nil, region: .local) returns DateInRegion in correct timezone

Is this intended?

@malcommac
Copy link
Owner

No, it was a bug.
Thanks, it was fixed in 6.0.3.

@malcommac malcommac added the bug label May 11, 2019
@malcommac malcommac self-assigned this May 11, 2019
@malcommac malcommac added this to the 6.0.3 milestone May 11, 2019
@malcommac malcommac changed the title toISODate(region:) does not work as expected toISODate(region:) ignores explicitly passed Region May 11, 2019
@adrianod1as
Copy link
Contributor

@malcommac is there any chance this bug is still happening? Even though I am passing the region, region is nil when reaching the method.

Using SwiftDate (6.1.0)
Screen Shot 2019-12-21 at 11 14 16
Screen Shot 2019-12-21 at 11 14 37

I even tried removing derivated data, cache, all my pods and reinstalling them again, but this behaviour keeps happening. Any idea what might be happening?

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

No branches or pull requests

3 participants