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

Chronological ordering event keys by event date #5170

Open
ngreen-gt opened this issue Apr 12, 2023 · 0 comments
Open

Chronological ordering event keys by event date #5170

ngreen-gt opened this issue Apr 12, 2023 · 0 comments

Comments

@ngreen-gt
Copy link

Currently returning event keys (e.g. with /team/{team_key}/events/{year}/keys) will list them alphabetically. This was more difficult when trying to get the team's first two events in calculating a district point for teams going to regionals. It would be trivial if the event keys were instead in chronological order.

Current output example

[
  {
    "city": "Houston",
    "country": "USA",
    "district": null,
    "end_date": "2023-04-22",
    "event_code": "cmptx",
    "event_type": 4,
    "key": "2023cmptx",
    "name": "FIRST Championship - FIRST Robotics Competition",
    "start_date": "2023-04-19",
    "state_prov": "TX",
    "year": 2023
  },
  {
    "city": "Cedar Falls",
    "country": "USA",
    "district": null,
    "end_date": "2023-03-25",
    "event_code": "iacf",
    "event_type": 0,
    "key": "2023iacf",
    "name": "Iowa Regional",
    "start_date": "2023-03-22",
    "state_prov": "IA",
    "year": 2023
  },
  {
    "city": "Shawnee",
    "country": "USA",
    "district": null,
    "end_date": "2023-03-11",
    "event_code": "okok",
    "event_type": 0,
    "key": "2023okok",
    "name": "Oklahoma Regional",
    "start_date": "2023-03-08",
    "state_prov": "OK",
    "year": 2023
  },
  {
    "city": "Tulsa",
    "country": "USA",
    "district": null,
    "end_date": "2023-04-08",
    "event_code": "oktu",
    "event_type": 0,
    "key": "2023oktu",
    "name": "Green Country Regional",
    "start_date": "2023-04-05",
    "state_prov": "OK",
    "year": 2023
  }
]

Expected output example

[
  {
    "city": "Shawnee",
    "country": "USA",
    "district": null,
    "end_date": "2023-03-11",
    "event_code": "okok",
    "event_type": 0,
    "key": "2023okok",
    "name": "Oklahoma Regional",
    "start_date": "2023-03-08",
    "state_prov": "OK",
    "year": 2023
  },
  {
    "city": "Cedar Falls",
    "country": "USA",
    "district": null,
    "end_date": "2023-03-25",
    "event_code": "iacf",
    "event_type": 0,
    "key": "2023iacf",
    "name": "Iowa Regional",
    "start_date": "2023-03-22",
    "state_prov": "IA",
    "year": 2023
  },
  {
    "city": "Tulsa",
    "country": "USA",
    "district": null,
    "end_date": "2023-04-08",
    "event_code": "oktu",
    "event_type": 0,
    "key": "2023oktu",
    "name": "Green Country Regional",
    "start_date": "2023-04-05",
    "state_prov": "OK",
    "year": 2023
  },
  {
    "city": "Houston",
    "country": "USA",
    "district": null,
    "end_date": "2023-04-22",
    "event_code": "cmptx",
    "event_type": 4,
    "key": "2023cmptx",
    "name": "FIRST Championship - FIRST Robotics Competition",
    "start_date": "2023-04-19",
    "state_prov": "TX",
    "year": 2023
  }
]

Expected Behavior

That the event code output for /team/{team_key}/events/{year} and additional /simple and /keys would be sorted by the event start date chronologically.

Current Behavior

The output seems sorted alphabetically by the event key.

Context

Trying to access teams' first two events chronologically to make a regional team pseudo-district point ranking.

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

1 participant