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

Leave Time in local time zone #460

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

drewish
Copy link
Contributor

@drewish drewish commented Nov 16, 2018

I've been on a bit of a quest to figure out how to convert UTC timestamps into the correct dates for invoices and payments. I'd tried using time zone hash I'd posted on #458 along with Rails' time zone extensions to set the dates to a Time in the organization's time zone assuming that would end up as the correct... but strangely it kept using the UTC time... eventually I found where the Times and Dates are serialized into XML and discovered my hard work was being undone.

Since Xero doesn't use any time or time zone component for it's date fields I don't think we should be converting them to UTC before saving them. So this PR removes that.

My temporary work around is put the Time into the right time zone then call to_date so there's no further conversion before it's serialized into XML.

@CloCkWeRX
Copy link
Collaborator

That sounds reasonable, but I'm not sure (haven't been hands on for a while with this gem); and I can see problems with casting time to UTC but not date as we have in the current code. Might defer to other reviewers for input.

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

Successfully merging this pull request may close these issues.

2 participants