XeroAPI / xero-python-oauth2-starter

MIT License
30 stars 51 forks source link

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

Open david-bergman opened 1 year ago

david-bergman commented 1 year ago

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[bot] commented 1 year ago

PETOSS-291

github-actions[bot] commented 1 year ago

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