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

Automatically convert Unix timestamps to DateTimes #1316

Merged
merged 1 commit into from Oct 2, 2018

Conversation

ob-stripe
Copy link
Contributor

r? @remi-stripe
cc @stripe/api-libraries

Copy link
Contributor

@remi-stripe remi-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O
M
G
:micdrop:

Joke aside: This looks amazing and so much easier to not mess up or forget.

Is there any risk that this changes some default behaviour with DateTime? I don't know anything about that type and was curious if people could have configured things like default timezone and such for us to convert properly and now that the conversion is hidden in the internals maybe they can't? Likely not a realistic thought though

@@ -10,7 +10,7 @@ public static void Map(object value, Action<string> updateId, Action<T> updateOb
{
if (value is JObject)
{
T item = ((JToken)value).ToObject<T>();
T item = Mapper<T>.MapFromJson(value.ToString());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you document this line explicitly as to what it does, why the change and maybe a TODO to figure out in the future how to avoid the parsed => toString => parsed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep!

@ob-stripe ob-stripe force-pushed the ob-auto-convert-datetime branch 2 times, most recently from d82c63c to 4b8bdfb Compare October 2, 2018 14:02
@ob-stripe ob-stripe mentioned this pull request Oct 2, 2018
32 tasks
@ob-stripe ob-stripe merged commit 971915b into integration-next-major-version Oct 2, 2018
@ob-stripe ob-stripe deleted the ob-auto-convert-datetime branch October 2, 2018 14:35
@ob-stripe ob-stripe mentioned this pull request Dec 11, 2018
29 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants