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

More Flexible Calendar Search Date Formats #6081

Open
rfultz opened this issue Dec 16, 2024 · 0 comments · May be fixed by #6090
Open

More Flexible Calendar Search Date Formats #6081

rfultz opened this issue Dec 16, 2024 · 0 comments · May be fixed by #6090
Assignees
Milestone

Comments

@rfultz
Copy link
Contributor

rfultz commented Dec 16, 2024

What we’re after

I'd like to be able to use calendar-dates queries with date formats that aren't exactly mm/dd/YYYY or YYYY-mm-dd, specifically I'd like ISO8601 format YYYY-mm-ddTHH:MM:SS[+|-]HH:MM not to be rejected.
Optionally, YYYY-mm-ddTHH:MM:SSZ or YYYYmmddTHHMMSSZ

For this specific use case (Fullcalendar), changing our format validation from a strictly equals to a starts with would work fine, i.e. if we evaluated only what's before the T.

Possible complications: do we want to apply the expanded format to other date validations?

These are under /dates/. I definitely need those under /calendar-dates/

/dates/
  /v1/calendar-dates/
    min_start_date
    min_end_date
    max_start_date
    max_end_date
  /v1/calendar-dates-export/ ?
    min_start_date
    min_end_date
    max_start_date
    max_end_date
  /v1/election-dates/
    min_election_date (the Swagger interface doesn't specify a format)
    max_election_date (the Swagger interface doesn't specify a format)
    min_create_date
    max_create_date
    min_update_date
    max_update_date
    min_primary_general_date
    max_primary_general_date
  /v1/reporting-dates/
    min_due_date
    max_due_date
    min_create_date
    max_create_date
    min_update_date
    max_update_date

Related ticket(s)

None

Action item(s)

(These are the smaller tasks that should happen in order to complete this work)

  • [ ]

Completion criteria

  • Current date formats are still valid (with the new one, as decided)

  • Querying with start and dates in the ISO formats returns results as expected (without errors)
    /v1/calendar-dates/?per_page=500&min_start_date=2024-12-01T00%3A00%3A00-05%3A00&max_start_date=2025-01-01T00%3A00%3A00-05%3A00
    returns the same results as
    /v1/calendar-dates/?per_page=500&min_start_date=2024-12-01&max_start_date=2025-01-01

References/resources/technical considerations

(Is there sample code or a screenshot you can include to highlight a particular issue? Here is where you reinforce why this work is important)

@rfultz rfultz added this to the 27.2 milestone Dec 16, 2024
@patphongs patphongs moved this to 🔨 Pre-refinement in Website project Dec 19, 2024
@rfultz rfultz moved this from 🔨 Pre-refinement to 🗄️ PI backlog in Website project Dec 19, 2024
@rfultz rfultz moved this from 🗄️ PI backlog to 🔜 Sprint backlog in Website project Dec 19, 2024
@rfultz rfultz moved this from 🔜 Sprint backlog to 📥 Assigned in Website project Dec 19, 2024
@cnlucas cnlucas linked a pull request Dec 27, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 📥 Assigned
Development

Successfully merging a pull request may close this issue.

2 participants