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

Cloud Api -- ISO 8601 - RFC 3339 Format ? #34

Open
david-bergman opened this issue Mar 31, 2023 · 2 comments
Open

Cloud Api -- ISO 8601 - RFC 3339 Format ? #34

david-bergman opened this issue Mar 31, 2023 · 2 comments

Comments

@david-bergman
Copy link

I had to modify the code in the deserializer.py on line 216, as the api is returning the datetime in the ISO 8601 format, it seemed to only work when I convert the date into the RFC 3339, so including the Z at the end...

not sure if there is a way in the XERO configuration to specify the date format to be returned in the API?

This is using the Demo account, as I am trying to just get a feel for the API..

if data is not None:
    try:
        dt = isoparse(data[:16] + 'Z')
    except (ValueError, TypeError):
        raise ValueError("Invalid datetime value {!r}".format(data[:16] + 'Z'))

    if not dt.tzinfo:
        # timezone naive datetime from Xero API response always in UTC
        dt = dt.replace(tzinfo=tz.UTC)

    return dt
@github-actions
Copy link

PETOSS-291

@github-actions
Copy link

Thanks for raising an issue, a ticket has been created to track your request

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

No branches or pull requests

1 participant