Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

start_date and end_date in GET /company/time-offs do not work as advertised #105

Open
mdbenito opened this issue Mar 8, 2022 · 1 comment

Comments

@mdbenito
Copy link
Contributor

mdbenito commented Mar 8, 2022

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 on end_date including absences from the end_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?

@mdbenito mdbenito changed the title start_date and end_date in GET do not work as advertised start_date and end_date in GET /company/time-offs do not work as advertised Mar 8, 2022
@lmf-git
Copy link

lmf-git commented Oct 2, 2023

@mdbenito glad I'm not the only one who is confused, I really believe they need a current endpoiint or status on the employee to avoid all of this time/date comparison.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants