ruckus / quickeebooks

ABANDONED !!!! Quickbooks + Ruby using the Quickbooks Online v2 Data Services REST API
MIT License
79 stars 67 forks source link

IntuitRequestException: cvc-datatype-valid.1.2.1 #124

Open patrickreiner opened 10 years ago

patrickreiner commented 10 years ago

The %Z in Quickeebooks::Shared::Service::Filter::DATE_TIME_FORMAT seems to be causing the following error:

IntuitRequestException: cvc-datatype-valid.1.2.1: '2013-09-04T16:52:30UTC' is not a valid value for 'dateTime'.

When I set the constant to '%Y-%m-%dT%H:%M:%S' it works fine. This is how I build my filters:

  filters.push Quickeebooks::Windows::Service::Filter.new(:datetime, field: 'StartModifiedTMS', value: Time.mktime(2013, 1, 1))
  filters.push Quickeebooks::Windows::Service::Filter.new(:datetime, field: 'EndModifiedTMS', value: Time.mktime(2025, 1, 1))
ruckus commented 10 years ago

This has been an on-going issue and I always forget the overall resolution.

If you look in this issue: https://github.com/ruckus/quickeebooks/pull/87

and this one: https://github.com/ruckus/quickeebooks/issues/86

it seems like it boils down to how the Filter is created, either with Time.mktime or using a DateTime (maybe an ActiveSupport sub-class if in a Rails environment).

In #86 it looks like he is using Time.mktime as well - but its not working for you(?)