shift-org / shift-org/shift-docs

Change default events API behavior when startdate and/or enddate aren't specified

Open
#553 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

API backend enhancement
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 startdate often returns an error since enddate is implied as today; any future startdate, or a past startdate more than 100 days ago, will return a 400 error
  • If only enddate is 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 startdate always 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 enddate error cases
  • If neither is provided, events for the current date +9 days (= 10 day range) are returned
  • pagination object 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.