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

Fix #attribute_to_time timezone issues #724

Merged
merged 4 commits into from Nov 10, 2015
Merged

Conversation

denisdefreyne
Copy link
Member

When give a Date or String instance, #attribute_to_time does not have timezone information, and so I believe the correct approach is to treat the argument as local time. The tests failed in UTC since they did not take the time offset into account.

This PR makes the argument be treated as local time. (Enhancement rather than a bug, because it’s mostly the specs being wrong, and the documentation being vague.)

A small bonus change involves refactoring #attribute_to_time so it no longer has assignments or explicit type checks with if.

Also see #717.

denisdefreyne added a commit that referenced this pull request Nov 10, 2015
Fix #attribute_to_time timezone issues
@denisdefreyne denisdefreyne merged commit 484150f into master Nov 10, 2015
@denisdefreyne denisdefreyne deleted the fix-timezone-issues branch November 10, 2015 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants