Inconsistent handling of date/time fields

Note: This is one of multiple posts about issues I’ve discovered while working depth with the Pipedrive API. A description of the use case and collection of all issues can be found at pipedrive-api-notes.md · GitHub.


date and time fields are handled inconsistently. The most obvious examples are in the
activities resource:

  • due_date says it’s a date and it actually is (YYYY-MM-DD)
  • add_time says it’s a time, but it really is a datetime (YYYY-MM-DD HH:MM:SS)
  • due_time says it’s a time and it is, if you consider “time” to be a “time of day” (HH:MM)
    rather than a more database-like definition of time (= datetime)
  • duration says it’s a time but apparently it goes beyond values of 23:59 (e.g. we have an
    activity with a value of 48:00 here, which presumably means 2 days)

I think this should be handled consistently: If there’s a type date, then it shouldn’t sometimes
be used as a date and sometimes as a datetime; if there’s a type time, it’s fine that it’s
treated as a “time of day”, but then it shouldn’t be used to represent a duration that can go
beyond valid ranges for a time of day (= 00:00 to 23:59).

Hi,
Thanks for taking the time to capture the relevant details :slight_smile: I have moved this to #feedback for broader attention.