-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Improve support for parsing iso8601 dates #302
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
Improve support for parsing iso8601 dates #302
Conversation
+1 looks good to me |
RestSharp.Tests/JsonTests.cs
Outdated
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.
Is there a reason these assertions use string comparison instead of comparing the DateTimes directly?
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.
That's what all the other ones do and I wanted to do it the same way. Other than that, there's no reason. Should I compare directly?
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.
I've changed all comparisons to be more sane and removed some other whitespace stuff.
I was just about to merge this change, but think something got broke regarding the tests, because GitHub now states "pull request cannot be automatically merged"; can you merge the current code version on the repository with your code and update the pull request? |
@pedrolamas That "something" was you changing the line-endings in the That change seems unrelated to what was otherwise happening, it should have been in a separate branch, why did you add it? At any rate, I've rebased this branch. |
I didn't change it knowingly, my Visual Studio must have done it for me and it slipped "under the radar" when I pushed the changes... :\ Sorry for the extra-work and thank you for the help! |
…01-dates Improve support for parsing iso8601 dates
RestSharp currently fails to parse
DateTime
formatted byNewtonsoft.Json.Converters.IsoDateTimeConverter
.DateTime.Parse()
does a pretty good job on these so I've added that as a last-ditch attempt. Alternatively, it should be attempted inJsonDeserializer.Map
if noDateFormat
is specified.