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

dateWithJSONObject: method cannot parse ISO 8601 dates with a time zone designator "+hhmm" or "-hhmm" #765

Closed
tmpduarte opened this issue Jun 10, 2015 · 4 comments
Assignees
Milestone

Comments

@tmpduarte
Copy link

I tried the following in the Xcode command line

po [CBLJSON dateWithJSONObject:@"2015-03-25T07:59:42+00:00"];
2015-03-25 07:59:42 +0000

po [CBLJSON dateWithJSONObject:@"2015-03-25T07:59:42+0000"];
nil

The only difference here is the Time Zone Designator which changes from +00:00 to +0000. According to the ISO 8601 both designators are allowed.
It was expected that both po attempts should return the same date which does not happen.

I am using couchbase lite v1.0 from cocoapods pod 'couchbase-lite-ios', '~> 1.0'.

@tmpduarte
Copy link
Author

I investigated a bit more and I found that couchbase seems more compliant with this W3C note that limits the scope of the ISO 8601 to a more restricted subset.

@snej
Copy link
Contributor

snej commented Jun 10, 2015

Fixed in commit e2aeb39

@snej snej closed this as completed Jun 10, 2015
@snej snej reopened this Jun 10, 2015
@snej
Copy link
Contributor

snej commented Jun 10, 2015

Reopened because the fix didn't work (and I reverted the commit.)

@zgramana zgramana added this to the 1.1.0 milestone Jun 12, 2015
@zgramana zgramana added the bug label Jun 12, 2015
@snej
Copy link
Contributor

snej commented Jun 19, 2015

Fixed for real by #767 (and I verified that the tests pass.)

@snej snej closed this as completed Jun 19, 2015
@pasin pasin modified the milestones: 1.1.1, 1.1.0 Jul 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants