shift-org / shift-org/shift-docs
Change default events API behavior when startdate and/or enddate aren't specified
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 30
- Forks
- 25
- Avg merge
- 9m
- Merged PRs (30d)
- 1
Description
We recommend clients always make events API requests for a single event by id, or a range of dates with the startdate and enddate parameters. If an id is provided, it takes precedence; if not, we look for a range.
If the client doesn't specify them, startdate and enddate both default to the current date:
- Providing only
startdateoften returns an error sinceenddateis implied as today; any futurestartdate, or a paststartdatemore than 100 days ago, will return a 400 error - If only
enddateis provided and it's before the current date or more than 100 days from the current date, a 400 error is returned. - If neither is provided, events for the current date are returned (1 day range)
Proposed: startdate defaults to current date; enddate defaults to startdate +9 days (= 10 day range)
- Providing only
startdatealways gives you 10 days of events (current date + 9 days, which is what the/calendar/list view currently shows by default), regardless of how far in the past or future - Same
enddateerror cases - If neither is provided, events for the current date +9 days (= 10 day range) are returned
paginationobject in response would be explicit about what implicit range was actually returned (see #552)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the events API implementation and comparing its defaults with the /calendar/ list view behavior; review issue #552 for the pagination response requirement. Done means omitted dates produce the proposed 10-day range, explicit enddate error cases remain unchanged, and the response pagination object reports the implicit range.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100