start_date and end_date in GET /company/time-offs do not work as advertised
mdbenito opened this issue · comments
curl --request GET \
--url 'https://api.personio.de/v1/company/time-offs?start_date=2022-03-07&end_date=2022-03-09&limit=200&offset=0'
returns results like:
{
"type":"TimeOffPeriod",
"attributes":{
"id":89788232,
"start_date":"2022-03-01T00:00:00+01:00",
"end_date":"2022-03-07T00:00:00+01:00",
"days_count":5,
...
}
and
{
"type":"TimeOffPeriod",
"attributes":{
"id":20513927,
"start_date":"2020-11-13T00:00:00+01:00",
"end_date":"2022-09-07T00:00:00+02:00",
"days_count":664,
...
}
The documentation states
end_date
date
Last day of the period to be queried. It is inclusive, so the result ends onend_date
including absences from theend_date
So the first result can be attributed to a confusing wording (does "absences from the end_date
" mean "absences starting up to end_date
? One would expect end_date
to delimit the last date to pull absences from)
However, the second result is more strange: Both the start_date
and end_date
are way beyond the range in the query.
Does the query return any absences which intersect the time interval defined by start_date
and end_date
? And if so, is this interval closed, half-open or open?