xero-python-oauth2-starter icon indicating copy to clipboard operation
xero-python-oauth2-starter copied to clipboard

Cloud Api -- ISO 8601 - RFC 3339 Format ?

Open david-bergman opened this issue 2 years ago • 2 comments

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

david-bergman avatar Mar 31 '23 14:03 david-bergman

PETOSS-291

github-actions[bot] avatar Mar 31 '23 14:03 github-actions[bot]

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

github-actions[bot] avatar Mar 31 '23 14:03 github-actions[bot]