Add to parameter to statistics API #202
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR to add:
to
parameter on the statistics APIfrom_date == today
to match the general closed-interval behavior of the APISome notes that might be of interest to document somewhere:
from
date andto
date in the results EXCEPT if you set thefrom
date to today. To match the general behavior of the API, I adjusted the code so whenfrom_date == today
, it returns today's trips. I can't test at the moment if this could also solve the problem with returning values at the beginning of weeks/months, but I can test further in the following weeks.from
/to
dates play a big role. If the user sets them to arbitrary dates (meaning: either or both dates don't match the beginning and end of the interval used) the API returns a summary of the trips within those two dates as if they represented a whole interval (i.e. a given month). The way data is presented can be confusing as it seems like it shows the data from the full calendar interval, not the requested interval. --> Open Question Should we enrich the result data with the requested date intervals so the data is more interpretable?to
parameter than with thefrom
and it can be set to a future date without making the API crash.